mirror of
https://github.com/rgrgogu/new_starr.git
synced 2026-09-27 00:12:54 +08:00
@@ -15,13 +15,20 @@
|
||||
const nodemailer = require('nodemailer');
|
||||
const { emailTemplates } = require('../data/email_body.data')
|
||||
|
||||
const port = Number(process.env.SMTP_PORT);
|
||||
|
||||
const transporter = nodemailer.createTransport({
|
||||
host: process.env.SMTP_HOST,
|
||||
port: Number(process.env.SMTP_PORT),
|
||||
host: process.env.SMTP_HOST,
|
||||
port,
|
||||
secure: port === 465,
|
||||
requireTLS: port === 587,
|
||||
auth: {
|
||||
user: process.env.SMTP_USER,
|
||||
pass: process.env.SMTP_PASS,
|
||||
},
|
||||
tls: {
|
||||
rejectUnauthorized: false,
|
||||
},
|
||||
});
|
||||
|
||||
const sendEmail = async ({ to, type, data = {} }) => {
|
||||
@@ -39,7 +46,7 @@ const sendEmail = async ({ to, type, data = {} }) => {
|
||||
{
|
||||
from: {
|
||||
name: "STARR System",
|
||||
address: "do-not-reply@philproperties.com",
|
||||
address: process.env.EMAIL_FROM,
|
||||
},
|
||||
to,
|
||||
subject,
|
||||
|
||||
Reference in New Issue
Block a user