Add Email Templates migration#190
Conversation
…to add-email-templates-migration
…-> TYPE_PROJECT_EMAIL_TEMPLATE; drop GROUP_TEMPLATES)
Greptile SummaryAdds
Confidence Score: 3/5The destination write path and the new resource class are solid, but the source export passes optional API fields directly to typed constructor parameters without null-coalescing, which can crash mid-migration for any project whose templates have no custom sender or reply-to values. The null-coalescing gap in exportEmailTemplates means any template without a custom senderName, senderEmail, replyToEmail, or replyToName (i.e., one using Appwrite defaults) could cause a TypeError that aborts the migration for that project. The same defensive pattern is already applied in EmailTemplate::fromArray, so the fix is straightforward, but the bug is on the hot path of the export loop. src/Migration/Sources/Appwrite.php — the exportEmailTemplates method around the new EmailTemplate(...) constructor call. Important Files Changed
Reviews (1): Last reviewed commit: "Fold email templates into projects group..." | Re-trigger Greptile |
Summary
TYPE_PROJECT_EMAIL_TEMPLATEtoGROUP_PROJECTS_RESOURCESfor migrating the project's per-locale email template overrides.Sources/Appwrite) reads templates viaProject::listEmailTemplates(offset-paginated; not cursor) and emits oneEmailTemplateresource per (type, locale).Destinations/Appwrite) replays them viaProject::updateEmailTemplatefor each entry.GROUP_PROJECTSalongsidePROJECT_VARIABLE/PROJECT_PROTOCOLS/PROJECT_LABELS/PROJECT_SERVICES.Test plan
testAppwriteMigrationEmailTemplates(in appwrite/appwrite) passes