mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-06-01 05:11:34 +02: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:
committed by
Copybot
parent
7ea72025af
commit
cc9f61a92e
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user