mirror of
https://github.com/documenso/documenso.git
synced 2026-07-26 01:45:08 +10:00
fix: add multi email transport system (#2942)
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user