Implement remaining email config

This commit is contained in:
Br0wnHammer committed 2025-06-12 00:39:47 +05:30
1 parent 1794429cbe
commit de3d38d891
8 files changed
+64 -18

No files matched your search

+10 -17
View File
@@ -101,6 +101,8 @@ class EmailService {
const {
systemEmailHost,
systemEmailPort,
systemEmailSecure,
systemEmailPool,
systemEmailUser,
systemEmailAddress,
systemEmailPassword,
@@ -111,32 +113,23 @@ class EmailService {
systemEmailRejectUnauthorized,
} = config;
const baseEmailConfig = {
const emailConfig = {
host: systemEmailHost,
port: Number(systemEmailPort),
secure: true,
secure: systemEmailSecure,
auth: {
user: systemEmailUser || systemEmailAddress,
pass: systemEmailPassword,
},
connectionTimeout: 5000,
pool: systemEmailPool,
tls: { rejectUnauthorized: systemEmailRejectUnauthorized },
ignoreTLS: systemEmailIgnoreTLS,
requireTLS: systemEmailRequireTLS,
servername: systemEmailTLSServername,
name: systemEmailConnectionHost || "localhost",
};
const isSmtps = Number(systemEmailPort) === 465;
const emailConfig = !isSmtps
? {
...baseEmailConfig,
name: systemEmailConnectionHost || "localhost",
secure: false,
pool: true,
tls: { rejectUnauthorized: systemEmailRejectUnauthorized },
ignoreTLS: systemEmailIgnoreTLS,
requireTLS: systemEmailRequireTLS,
servername: systemEmailTLSServername,
}
: baseEmailConfig;
this.transporter = this.nodemailer.createTransport(emailConfig);
const buildHtml = async (template, context) => {