email-cg-lib
Advanced tools
Comparing version 0.0.5-SNAPSHOT to 1.0.0
@@ -7,4 +7,2 @@ let nodemailer = require('nodemailer'); | ||
return new Promise(async (resolve, reject) => { | ||
let transporter=null; | ||
try { | ||
@@ -28,3 +26,3 @@ log.info('Inside email lib'); | ||
transporter = nodemailer.createTransport({ | ||
const transporter = nodemailer.createTransport({ | ||
//Para GMail ---> host: 'smtp.gmail.com', port: 465, | ||
@@ -51,12 +49,11 @@ //Para Outlook ---> "host":"smtp.gmail.com", "port":465 | ||
await transporter.sendMail(mailOptions, function(error, info){ | ||
if (error) {return reject(error);} | ||
else { | ||
log.info(constants.SUCCESS_TRANS, info.response); | ||
return resolve({response:'Correo enviado: ' + info.response});} | ||
const result = transporter.sendMail(mailOptions, function(error, info){ | ||
if (error) {reject(error);} | ||
else {resolve({response:'Correo enviado: ' + info.response});} | ||
transporter.close(); | ||
}); | ||
//resolve(result); | ||
resolve(result); | ||
log.info(constants.SUCCESS_TRANS, result) | ||
@@ -69,6 +66,3 @@ } | ||
} | ||
finally{ | ||
transporter.close(); | ||
} | ||
}); | ||
}; |
{ | ||
"name": "email-cg-lib", | ||
"version": "0.0.5-SNAPSHOT", | ||
"version": "1.0.0", | ||
"description": "Email to send emails with basic information.", | ||
@@ -22,2 +22,3 @@ "main": "index.js", | ||
"dependencies": { | ||
"msgbroker-nxg-cg": "^0.1.0", | ||
"nodemailer": "^6.7.5", | ||
@@ -24,0 +25,0 @@ "utils-nxg-cg": "^1.0.7" |
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
2
3217
3
81
+ Addedmsgbroker-nxg-cg@^0.1.0