X-Git-Url: https://git.auder.net/?p=vchess.git;a=blobdiff_plain;f=utils%2Fmailer.js;fp=utils%2Fmailer.js.dist;h=c8080b957547b7d2b621b97c93ab50caea3100a1;hp=06cdc591c6277f7fd6b1662805de58f1a0c9360b;hb=0bd5933d97a90473233d0f90f465a43aba430ffa;hpb=b57dbd126734b4398861292c611197c6991ed3eb diff --git a/utils/mailer.js.dist b/utils/mailer.js similarity index 76% rename from utils/mailer.js.dist rename to utils/mailer.js index 06cdc591..c8080b95 100644 --- a/utils/mailer.js.dist +++ b/utils/mailer.js @@ -1,17 +1,16 @@ const nodemailer = require('nodemailer'); +const params = require("../config/parameters"); -const contact = "your_contact_email"; - -const send = function(from, to, subject, body, cb) +module.exports = function(from, to, subject, body, cb) { // Create reusable transporter object using the default SMTP transport const transporter = nodemailer.createTransport({ - host: "smtp_host_address", - port: 465, //if secure; otherwise use 587 - secure: true, + host: params.mail.host, + port: params.mail.port, + secure: params.mail.secure, auth: { - user: "user_name", - pass: "user_password" + user: params.mail.user, + pass: params.mail.pass } }); @@ -42,9 +41,4 @@ const send = function(from, to, subject, body, cb) //console.log('Message sent: %s', info.messageId); return cb(); }); -}; - -module.exports = { - contact: contact, - send: send -}; +}