mirror of
https://github.com/HeyPuter/puter
synced 2024-11-15 06:15:47 +00:00
Notify old email when email change is initiated
This commit is contained in:
parent
fd59a6c994
commit
79d6f64451
@ -79,6 +79,11 @@ const CHANGE_EMAIL_START = eggspress('/change_email/start', {
|
|||||||
confirm_url: `${config.origin}/change_email/confirm?token=${jwt_token}`,
|
confirm_url: `${config.origin}/change_email/confirm?token=${jwt_token}`,
|
||||||
username: user.username,
|
username: user.username,
|
||||||
});
|
});
|
||||||
|
const old_email = user.email;
|
||||||
|
// TODO: NotificationService
|
||||||
|
await svc_email.send_email({ email: old_email }, 'email_change_notification', {
|
||||||
|
new_email: new_email,
|
||||||
|
});
|
||||||
|
|
||||||
// update user
|
// update user
|
||||||
await db.write(
|
await db.write(
|
||||||
|
@ -63,6 +63,17 @@ We received a request to link this email to the user "{{username}}" on Puter. If
|
|||||||
|
|
||||||
<p>
|
<p>
|
||||||
<a href="{{confirm_url}}">Confirm email change</a>
|
<a href="{{confirm_url}}">Confirm email change</a>
|
||||||
|
</p>
|
||||||
|
`,
|
||||||
|
},
|
||||||
|
'email_change_notification': {
|
||||||
|
subject: '\u{1f4dd} Notification of email change',
|
||||||
|
html: `
|
||||||
|
<p>Hi there,</p>
|
||||||
|
<p>
|
||||||
|
We're sending an email to let you know about a change to your account.
|
||||||
|
We have sent a confirmation to "{{new_email}}" to confirm an email change request.
|
||||||
|
If this was not you, please contact support@puter.com immediately.
|
||||||
</p>
|
</p>
|
||||||
`,
|
`,
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user