diff --git a/services/web/app/src/Features/Email/EmailSender.js b/services/web/app/src/Features/Email/EmailSender.js index 6433bd59f9..dee3be40d8 100644 --- a/services/web/app/src/Features/Email/EmailSender.js +++ b/services/web/app/src/Features/Email/EmailSender.js @@ -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) diff --git a/services/web/app/src/Features/User/UserEmailsConfirmationHandler.js b/services/web/app/src/Features/User/UserEmailsConfirmationHandler.js index 48fcbafc9a..399c4a080d 100644 --- a/services/web/app/src/Features/User/UserEmailsConfirmationHandler.js +++ b/services/web/app/src/Features/User/UserEmailsConfirmationHandler.js @@ -60,6 +60,7 @@ async function sendConfirmationCode(email) { await EmailHandler.promises.sendEmail('confirmCode', { to: email, confirmCode, + category: ['ConfirmEmail'], }) return {