Inicio de proyecto
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
require('../config/config');
|
||||
|
||||
const send = require('gmail-send')({
|
||||
user: process.env.GMAIL,
|
||||
pass: process.env.GMAILPASSWORD,
|
||||
});
|
||||
|
||||
const gmail = (subject, to, text) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
send({ subject, to, text }, (error, result, fullResult) => {
|
||||
if (error) reject(error);
|
||||
console.log(fullResult);
|
||||
resolve(result);
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
module.exports = gmail;
|
||||
Reference in New Issue
Block a user