1
0
Fork 0
mirror of synced 2024-10-01 01:37:56 +13:00

Merge pull request #6077 from appwrite/fix-email-templates

fix: missing variable in email templates
This commit is contained in:
Jake Barnby 2023-08-30 18:47:02 -04:00 committed by GitHub
commit 589e4f5c7d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 22 additions and 14 deletions

View file

@ -7,6 +7,7 @@
## Fixes
- Fix VCS/migration/assistant scopes [#6071](https://github.com/appwrite/appwrite/pull/6071)
- Add missing parameters required for custom email templates [#6077](https://github.com/appwrite/appwrite/pull/6077)
## Changes

View file

@ -1048,17 +1048,19 @@ App::post('/v1/account/sessions/magic-url')
$emailVariables = [
'subject' => $subject,
'hello' => $locale->getText("emails.magicSession.hello"),
'name' => '',
'body' => $body,
'redirect' => $url,
'footer' => $locale->getText("emails.magicSession.footer"),
'thanks' => $locale->getText("emails.magicSession.thanks"),
'signature' => $locale->getText("emails.magicSession.signature"),
'project' => $project->getAttribute('name'),
'direction' => $locale->getText('settings.direction'),
'bg-body' => '#f7f7f7',
'bg-content' => '#ffffff',
'text-content' => '#000000',
/* {{user}} ,{{team}}, {{project}} and {{redirect}} are required in the templates */
'user' => '',
'team' => '',
'project' => $project->getAttribute('name'),
'redirect' => $url
];
$mails
@ -2501,17 +2503,19 @@ App::post('/v1/account/recovery')
$emailVariables = [
'subject' => $subject,
'hello' => $locale->getText("emails.recovery.hello"),
'name' => $profile->getAttribute('name'),
'body' => $body,
'redirect' => $url,
'footer' => $locale->getText("emails.recovery.footer"),
'thanks' => $locale->getText("emails.recovery.thanks"),
'signature' => $locale->getText("emails.recovery.signature"),
'project' => $projectName,
'direction' => $locale->getText('settings.direction'),
'bg-body' => '#f7f7f7',
'bg-content' => '#ffffff',
'text-content' => '#000000',
/* {{user}} ,{{team}}, {{project}} and {{redirect}} are required in the templates */
'user' => $profile->getAttribute('name'),
'team' => '',
'project' => $projectName,
'redirect' => $url
];
@ -2751,17 +2755,19 @@ App::post('/v1/account/verification')
$emailVariables = [
'subject' => $subject,
'hello' => $locale->getText("emails.verification.hello"),
'name' => $user->getAttribute('name'),
'body' => $body,
'redirect' => $url,
'footer' => $locale->getText("emails.verification.footer"),
'thanks' => $locale->getText("emails.verification.thanks"),
'signature' => $locale->getText("emails.verification.signature"),
'project' => $projectName,
'direction' => $locale->getText('settings.direction'),
'bg-body' => '#f7f7f7',
'bg-content' => '#ffffff',
'text-content' => '#000000',
/* {{user}} ,{{team}}, {{project}} and {{redirect}} are required in the templates */
'user' => $user->getAttribute('name'),
'team' => '',
'project' => $projectName,
'redirect' => $url
];
$mails

View file

@ -599,20 +599,21 @@ App::post('/v1/teams/:teamId/memberships')
$emailVariables = [
'owner' => $user->getAttribute('name'),
'team' => $team->getAttribute('name'),
'subject' => $subject,
'hello' => $locale->getText("emails.invitation.hello"),
'name' => $user->getAttribute('name'),
'body' => $body,
'redirect' => $url,
'footer' => $locale->getText("emails.invitation.footer"),
'thanks' => $locale->getText("emails.invitation.thanks"),
'signature' => $locale->getText("emails.invitation.signature"),
'project' => $projectName,
'direction' => $locale->getText('settings.direction'),
'bg-body' => '#f7f7f7',
'bg-content' => '#ffffff',
'text-content' => '#000000',
/* {{user}} ,{{team}}, {{project}} and {{redirect}} are required in the templates */
'user' => $user->getAttribute('name'),
'team' => $team->getAttribute('name'),
'project' => $projectName,
'redirect' => $url
];
$mails

View file

@ -35,9 +35,9 @@ class MailsV1 extends Worker
$recipient = $this->args['recipient'];
$subject = $this->args['subject'];
$name = $this->args['name'];
$body = $this->args['body'];
$variables = $this->args['variables'];
$name = $variables['user'] ?? '';
$body = Template::fromFile(__DIR__ . '/../config/locale/templates/email-base.tpl');