mirror of
https://github.com/appwrite/appwrite.git
synced 2026-11-18 20:36:03 +00:00
Trim email template comments to the critical why
This commit is contained in:
1 parent
3c143860ca
commit
0525142c6f
2 files changed
+6
-11
No files matched your search
@@ -3316,12 +3316,9 @@ class Appwrite extends Destination
|
||||
}
|
||||
|
||||
/**
|
||||
* Direct DB write rather than the SDK's updateEmailTemplate — the SDK path
|
||||
* rejects the call unless custom SMTP is enabled on the project. Templates
|
||||
* may legitimately migrate before SMTP (different groups, different runs),
|
||||
* so bypass that check by writing the project.templates map directly.
|
||||
* Read-then-merge preserves any templates already configured on the
|
||||
* destination (other locales, untouched template types).
|
||||
* Direct DB write rather than the SDK's updateEmailTemplate, which rejects
|
||||
* the call unless custom SMTP is enabled — templates may migrate before SMTP.
|
||||
* Read-then-merge preserves templates already on the destination.
|
||||
*/
|
||||
protected function createEmailTemplate(EmailTemplate $resource): bool
|
||||
{
|
||||
|
||||
@@ -1622,8 +1622,7 @@ class Appwrite extends Source
|
||||
|
||||
if (\in_array(Resource::TYPE_PROJECT_EMAIL_TEMPLATE, $resources)) {
|
||||
try {
|
||||
// listEmailTemplates is paginated by limit/offset (not cursor); pass total: true
|
||||
// so the report count is accurate even if the page is empty.
|
||||
// total:true returns the real count without fetching every row.
|
||||
$report[Resource::TYPE_PROJECT_EMAIL_TEMPLATE] = $this->project->listEmailTemplates([Query::limit(1)], total: true)->total;
|
||||
} catch (\Throwable) {
|
||||
$report[Resource::TYPE_PROJECT_EMAIL_TEMPLATE] = 0;
|
||||
@@ -1853,9 +1852,8 @@ class Appwrite extends Source
|
||||
*/
|
||||
private function exportEmailTemplates(int $batchSize): void
|
||||
{
|
||||
// listEmailTemplates is offset-paginated (cursor not supported — the list is
|
||||
// assembled from a project attribute map, not a collection). Walk the offset
|
||||
// until a page comes back smaller than the requested limit.
|
||||
// Offset pagination: templates come from a project attribute map, not a
|
||||
// collection, so cursor pagination isn't available here.
|
||||
$offset = 0;
|
||||
|
||||
while (true) {
|
||||
|
||||
Reference in new issue
Block a user