mailer.js 569 Bytes
Newer Older
Wolfgang Knopki's avatar
Wolfgang Knopki committed
1
2
const nodemailer = require('nodemailer')

3
var env = process.env.NODE_ENV || 'testing';
Rosanny Sihombing's avatar
Rosanny Sihombing committed
4
const config = require('./config')[env]
Wolfgang Knopki's avatar
Wolfgang Knopki committed
5
6
7

var smtpTransport = nodemailer.createTransport({
    host: config.mailer.host,
8
    secure: config.mailer.secureConnection,
Wolfgang Knopki's avatar
Wolfgang Knopki committed
9
10
11
12
    port: config.mailer.port,
    auth: {
      user: config.mailer.authUser,
      pass: config.mailer.authPass
13
    }
Wolfgang Knopki's avatar
Wolfgang Knopki committed
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
});
  
var mailOptions = {
    to: "",
    from: config.mailer.from,
    subject: "",
    text: ""
};

var mailer = {
    transport: smtpTransport,
    options: mailOptions
}

module.exports = mailer