diff --git a/app/controllers/api/account.php b/app/controllers/api/account.php index eb4bc38db6..17369b0c36 100644 --- a/app/controllers/api/account.php +++ b/app/controllers/api/account.php @@ -1107,6 +1107,7 @@ $utopia->post('/v1/account/recovery') ; $mail + ->setParam('event', 'account.recovery.create') ->setParam('recipient', $profile->getAttribute('email', '')) ->setParam('name', $profile->getAttribute('name', '')) ->setParam('subject', Locale::getText('account.emails.recovery.title')) @@ -1250,6 +1251,7 @@ $utopia->post('/v1/account/verification') ; $mail + ->setParam('event', 'account.verification.create') ->setParam('recipient', $user->getAttribute('email')) ->setParam('name', $user->getAttribute('name')) ->setParam('subject', Locale::getText('account.emails.verification.title')) diff --git a/app/controllers/api/teams.php b/app/controllers/api/teams.php index cd545954b8..bff9629af7 100644 --- a/app/controllers/api/teams.php +++ b/app/controllers/api/teams.php @@ -333,12 +333,13 @@ $utopia->post('/v1/teams/:teamId/memberships') ; $mail - ->setParam('recipient', $email) - ->setParam('name', $name) - ->setParam('subject', sprintf(Locale::getText('account.emails.invitation.title'), $team->getAttribute('name', '[TEAM-NAME]'), $project->getAttribute('name', ['[APP-NAME]']))) - ->setParam('body', $body->render()) - ->trigger(); - ; + ->setParam('event', 'teams.membership.create') + ->setParam('recipient', $email) + ->setParam('name', $name) + ->setParam('subject', sprintf(Locale::getText('account.emails.invitation.title'), $team->getAttribute('name', '[TEAM-NAME]'), $project->getAttribute('name', ['[APP-NAME]']))) + ->setParam('body', $body->render()) + ->trigger(); + ; $audit ->setParam('userId', $invitee->getId()) diff --git a/app/workers/mails.php b/app/workers/mails.php index cb2fbd80fd..c46fda89dc 100644 --- a/app/workers/mails.php +++ b/app/workers/mails.php @@ -21,6 +21,7 @@ class MailsV1 { global $register; + $event = $this->args['event']; $recipient = $this->args['recipient']; $name = $this->args['name']; $subject = $this->args['subject'];