Files
servicio_social_api/server/helper/gmail.js
T

24 lines
418 B
JavaScript
Raw Normal View History

2020-11-17 21:04:57 -06:00
require('../config/config');
const send = require('gmail-send')({
user: process.env.GMAIL,
2020-11-22 20:36:55 -06:00
pass: process.env.GMAILPASSWORD,
2020-11-17 21:04:57 -06:00
});
const gmail = (subject, to, text) => {
2020-11-17 21:04:57 -06:00
return new Promise((resolve, reject) => {
send({ subject, to, text }, (error, result, fullResult) => {
if (error) reject(error);
resolve(result);
});
});
// return "envio de correo"
2020-11-17 21:04:57 -06:00
};
module.exports = gmail;