This commit is contained in:
Daniel Hougaard
2024-01-27 12:39:54 +05:30
committed by Akhil Mohan
parent a60dbe523b
commit c21ea6fb75
+1 -4
View File
@@ -53,9 +53,7 @@ export const getTlsOption = (host?: SmtpHost | string, secure?: boolean) => {
export const smtpServiceFactory = (cfg: TSmtpConfig) => { export const smtpServiceFactory = (cfg: TSmtpConfig) => {
const smtp = createTransport({ const smtp = createTransport({
...cfg, ...cfg,
...getTlsOption(cfg.host, cfg.secure), ...getTlsOption(cfg.host, cfg.secure)
secure: false,
port: 587
}); });
const isSmtpOn = Boolean(cfg.host); const isSmtpOn = Boolean(cfg.host);
@@ -65,7 +63,6 @@ export const smtpServiceFactory = (cfg: TSmtpConfig) => {
const htmlToSend = temp(substitutions); const htmlToSend = temp(substitutions);
if (isSmtpOn) { if (isSmtpOn) {
await smtp.sendMail({ await smtp.sendMail({
from: "[email protected]",
to: recipients.join(", "), to: recipients.join(", "),
subject: subjectLine, subject: subjectLine,
html: htmlToSend html: htmlToSend