diff --git a/server/lib/email/index.ts b/server/lib/email/index.ts index f9c0c7479..9f0a9fcfa 100644 --- a/server/lib/email/index.ts +++ b/server/lib/email/index.ts @@ -1,11 +1,15 @@ import Email from 'email-templates'; import nodemailer from 'nodemailer'; -import { NotificationAgentEmail } from '../settings'; +import { URL } from 'url'; +import { getSettings, NotificationAgentEmail } from '../settings'; import { openpgpEncrypt } from './openpgpEncrypt'; class PreparedEmail extends Email { public constructor(settings: NotificationAgentEmail, pgpKey?: string) { + const { applicationUrl } = getSettings().main; + const transport = nodemailer.createTransport({ + name: applicationUrl ? new URL(applicationUrl).hostname : undefined, host: settings.options.smtpHost, port: settings.options.smtpPort, secure: settings.options.secure,