diff --git a/ecosystem.config.js.template b/ecosystem.config.js.template index 200100f..7c9f152 100644 --- a/ecosystem.config.js.template +++ b/ecosystem.config.js.template @@ -17,11 +17,8 @@ module.exports = { BASE_URL: '', FROM: '', REPLY_TO: '', - // See https://nodemailer.com/smtp/ for all options - SMTP_OPTIONS: { - port: '', - host: '' - } + SMTP_HOST: '', + SMTP_PORT: '' }, env_production: { NODE_ENV: 'production', @@ -31,11 +28,8 @@ module.exports = { BASE_URL: '' FROM: '', REPLY_TO: '', - // See https://nodemailer.com/smtp/ for all options - SMTP_OPTIONS: { - port: '', - host: '' - } + SMTP_HOST: '', + SMTP_PORT: '' } } ] diff --git a/lib.js b/lib.js index bad5f4d..8d6c14e 100644 --- a/lib.js +++ b/lib.js @@ -4,8 +4,11 @@ const nodemailer = require('nodemailer'); const db = require('../ems-db'); const email = new Email(); -let smtpOptions = JSON.parse(process.env.SMTP_OPTIONS); -smtpOptions = {...smtpOptions, send: true}; +const smtpOptions = { + send: true, + host: process.env.SMTP_HOST, + port: process.env.SMTP_PORT +}; const transporter = nodemailer.createTransport(smtpOptions); const sendEmail = async ({to, name, queries, type}) => {