mirror of
https://github.com/overleaf/overleaf.git
synced 2025-04-09 16:09:08 +00:00
Added category support for sendgrid (#15970)
* Added category support for sendgrid * use category only for confirmation code GitOrigin-RevId: 1b93d8d0ac3699b9ad9f633f62b6471d163a2fba
This commit is contained in:
parent
1a4496ccfd
commit
b9834b0cbd
2 changed files with 7 additions and 0 deletions
|
@ -94,6 +94,12 @@ async function sendEmail(options) {
|
|||
if (EMAIL_SETTINGS.textEncoding != null) {
|
||||
sendMailOptions.textEncoding = EMAIL_SETTINGS.textEncoding
|
||||
}
|
||||
if (options.category) {
|
||||
// category support for sendgrid
|
||||
sendMailOptions.headers = {
|
||||
'X-SMTPAPI': JSON.stringify({ category: options.category }),
|
||||
}
|
||||
}
|
||||
await client.sendMail(sendMailOptions)
|
||||
} catch (err) {
|
||||
throw new OError('error sending message').withCause(err)
|
||||
|
|
|
@ -60,6 +60,7 @@ async function sendConfirmationCode(email) {
|
|||
await EmailHandler.promises.sendEmail('confirmCode', {
|
||||
to: email,
|
||||
confirmCode,
|
||||
category: ['ConfirmEmail'],
|
||||
})
|
||||
|
||||
return {
|
||||
|
|
Loading…
Add table
Reference in a new issue