Deshabilitada conexión SMTP en entorno test
This commit is contained in:
parent
492902e637
commit
ca25280743
|
@ -12,6 +12,8 @@ module.exports = {
|
|||
* Load mail config.
|
||||
*/
|
||||
init: function() {
|
||||
if (process.env.NODE_ENV == 'test')
|
||||
return;
|
||||
|
||||
this.transporter = nodemailer.createTransport(config.smtp);
|
||||
|
||||
|
@ -35,6 +37,9 @@ module.exports = {
|
|||
* @param {Object} cb - Callback
|
||||
*/
|
||||
send: function(recipient, subject, body, attachments, params, cb) {
|
||||
if (process.env.NODE_ENV == 'test')
|
||||
return;
|
||||
|
||||
let mailOptions = {
|
||||
from: '"' + config.app.senderName + '" <' + config.app.senderMail + '>',
|
||||
to: recipient,
|
||||
|
@ -43,9 +48,8 @@ module.exports = {
|
|||
attachments
|
||||
};
|
||||
|
||||
if (config.app.debug) {
|
||||
if (process.env.NODE_ENV != 'production')
|
||||
mailOptions.to = config.smtp.testEmail;
|
||||
}
|
||||
|
||||
this.transporter.sendMail(mailOptions, (error, info) => {
|
||||
try {
|
||||
|
|
Loading…
Reference in New Issue