Revert "refactor(email): set From at transport level instead of per-message"

This reverts commit baa4d693ae.
This commit is contained in:
gorkem-bwl committed 2026-04-29 15:42:02 -04:00
1 parent baa4d693ae
commit 8fbbb1dd4b
1 file changed
+4 -4
@@ -127,9 +127,6 @@ export class EmailService implements IEmailService {
systemEmailRejectUnauthorized,
} = config;
const trimmedDisplayName = systemEmailDisplayName?.trim();
const from = trimmedDisplayName && systemEmailAddress ? { name: trimmedDisplayName, address: systemEmailAddress } : systemEmailAddress;
const emailConfig = {
host: systemEmailHost,
port: Number(systemEmailPort),
@@ -141,7 +138,6 @@ export class EmailService implements IEmailService {
name: systemEmailConnectionHost || "localhost",
connectionTimeout: 5000,
pool: systemEmailPool,
from,
tls: {
rejectUnauthorized: systemEmailRejectUnauthorized,
ignoreTLS: systemEmailIgnoreTLS,
@@ -163,9 +159,13 @@ export class EmailService implements IEmailService {
return false;
}
const trimmedDisplayName = systemEmailDisplayName?.trim();
const from = trimmedDisplayName && systemEmailAddress ? { name: trimmedDisplayName, address: systemEmailAddress } : systemEmailAddress;
try {
const info = await this.transporter.sendMail({
to: to,
from: from,
subject: subject,
html: html,
});