fix: add multi email transport system (#2942)

This commit is contained in:
David Nguyen
2026-06-05 21:19:20 +10:00
committed by GitHub
parent ebf5b75a19
commit 4ee789ea37
67 changed files with 2440 additions and 115 deletions
@@ -75,6 +75,13 @@ export const sendOrganisationAccountLinkConfirmationEmail = async ({
},
});
// We only take `emailLanguage` here and intentionally ignore the resolved
// `emailTransport`/`senderEmail`. Unlike other INTERNAL emails, this is an
// auth-critical SSO account creation/linking confirmation: it must always be
// delivered from trusted Documenso infrastructure (see the `mailer.sendMail`
// below). Routing it through the organisation's own (potentially
// misconfigured) transport could block account linking and lock users out of
// their own SSO setup.
const { emailLanguage } = await getEmailContext({
emailType: 'INTERNAL',
source: {
@@ -101,6 +108,10 @@ export const sendOrganisationAccountLinkConfirmationEmail = async ({
const i18n = await getI18nInstance(emailLanguage);
// Deliberately uses the global Documenso mailer + internal sender (not the
// organisation's configured email transport) so auth/SSO confirmation mail is
// always sent from trusted, controlled infrastructure. See the note on the
// getEmailContext call above.
return mailer.sendMail({
to: {
address: user.email,