Skip to content

Commit 0525142

Browse files
committed
Trim email template comments to the critical why
1 parent 3c14386 commit 0525142

2 files changed

Lines changed: 6 additions & 11 deletions

File tree

src/Migration/Destinations/Appwrite.php

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3316,12 +3316,9 @@ protected function createSMTP(SMTP $resource): bool
33163316
}
33173317

33183318
/**
3319-
* Direct DB write rather than the SDK's updateEmailTemplate — the SDK path
3320-
* rejects the call unless custom SMTP is enabled on the project. Templates
3321-
* may legitimately migrate before SMTP (different groups, different runs),
3322-
* so bypass that check by writing the project.templates map directly.
3323-
* Read-then-merge preserves any templates already configured on the
3324-
* destination (other locales, untouched template types).
3319+
* Direct DB write rather than the SDK's updateEmailTemplate, which rejects
3320+
* the call unless custom SMTP is enabled — templates may migrate before SMTP.
3321+
* Read-then-merge preserves templates already on the destination.
33253322
*/
33263323
protected function createEmailTemplate(EmailTemplate $resource): bool
33273324
{

src/Migration/Sources/Appwrite.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1622,8 +1622,7 @@ private function reportProjects(array $resources, array &$report, array $resourc
16221622

16231623
if (\in_array(Resource::TYPE_PROJECT_EMAIL_TEMPLATE, $resources)) {
16241624
try {
1625-
// listEmailTemplates is paginated by limit/offset (not cursor); pass total: true
1626-
// so the report count is accurate even if the page is empty.
1625+
// total:true returns the real count without fetching every row.
16271626
$report[Resource::TYPE_PROJECT_EMAIL_TEMPLATE] = $this->project->listEmailTemplates([Query::limit(1)], total: true)->total;
16281627
} catch (\Throwable) {
16291628
$report[Resource::TYPE_PROJECT_EMAIL_TEMPLATE] = 0;
@@ -1853,9 +1852,8 @@ private function exportRules(int $batchSize): void
18531852
*/
18541853
private function exportEmailTemplates(int $batchSize): void
18551854
{
1856-
// listEmailTemplates is offset-paginated (cursor not supported — the list is
1857-
// assembled from a project attribute map, not a collection). Walk the offset
1858-
// until a page comes back smaller than the requested limit.
1855+
// Offset pagination: templates come from a project attribute map, not a
1856+
// collection, so cursor pagination isn't available here.
18591857
$offset = 0;
18601858

18611859
while (true) {

0 commit comments

Comments
 (0)