mensaje de pull a master
erge branch 'master' of https://repositorio.acatlan.unam.mx/CIDWA/servicio_social_api into dev
This commit is contained in:
Generated
+8
-6
@@ -24,6 +24,7 @@
|
||||
"mariadb": "^2.5.1",
|
||||
"moment": "^2.29.1",
|
||||
"multer": "^1.4.2",
|
||||
"nodemailer": "^6.10.1",
|
||||
"sequelize": "^6.3.5",
|
||||
"validator": "^13.1.17"
|
||||
},
|
||||
@@ -1994,9 +1995,10 @@
|
||||
}
|
||||
},
|
||||
"node_modules/nodemailer": {
|
||||
"version": "6.7.2",
|
||||
"resolved": "https://registry.npmjs.org/nodemailer/-/nodemailer-6.7.2.tgz",
|
||||
"integrity": "sha512-Dz7zVwlef4k5R71fdmxwR8Q39fiboGbu3xgswkzGwczUfjp873rVxt1O46+Fh0j1ORnAC6L9+heI8uUpO6DT7Q==",
|
||||
"version": "6.10.1",
|
||||
"resolved": "https://registry.npmjs.org/nodemailer/-/nodemailer-6.10.1.tgz",
|
||||
"integrity": "sha512-Z+iLaBGVaSjbIzQ4pX6XV41HrooLsQ10ZWPUehGmuantvzWoDVBnmsdUcOIDM1t+yPor5pDhVlDESgOMEGxhHA==",
|
||||
"license": "MIT-0",
|
||||
"engines": {
|
||||
"node": ">=6.0.0"
|
||||
}
|
||||
@@ -4525,9 +4527,9 @@
|
||||
"integrity": "sha512-Fcvtbb+zBcZXbTTVwqGA5W+MKBj56UjVRevvchv5XrcyXbmNdesfZL37nlcWOfpgHhgmxApw3tQbTr4CqNmX4w=="
|
||||
},
|
||||
"nodemailer": {
|
||||
"version": "6.7.2",
|
||||
"resolved": "https://registry.npmjs.org/nodemailer/-/nodemailer-6.7.2.tgz",
|
||||
"integrity": "sha512-Dz7zVwlef4k5R71fdmxwR8Q39fiboGbu3xgswkzGwczUfjp873rVxt1O46+Fh0j1ORnAC6L9+heI8uUpO6DT7Q=="
|
||||
"version": "6.10.1",
|
||||
"resolved": "https://registry.npmjs.org/nodemailer/-/nodemailer-6.10.1.tgz",
|
||||
"integrity": "sha512-Z+iLaBGVaSjbIzQ4pX6XV41HrooLsQ10ZWPUehGmuantvzWoDVBnmsdUcOIDM1t+yPor5pDhVlDESgOMEGxhHA=="
|
||||
},
|
||||
"nodemon": {
|
||||
"version": "2.0.15",
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
"mariadb": "^2.5.1",
|
||||
"moment": "^2.29.1",
|
||||
"multer": "^1.4.2",
|
||||
"nodemailer": "^6.10.1",
|
||||
"sequelize": "^6.3.5",
|
||||
"validator": "^13.1.17"
|
||||
},
|
||||
|
||||
+20
-17
@@ -1,23 +1,26 @@
|
||||
require('../config/config');
|
||||
require('../config/config'); // mantiene tu carga de variables
|
||||
const nodemailer = require('nodemailer');
|
||||
|
||||
const send = require('gmail-send')({
|
||||
user: process.env.GMAIL,
|
||||
pass: process.env.GMAILPASSWORD,
|
||||
const transporter = nodemailer.createTransport({
|
||||
host: 'smtp-relay.gmail.com',
|
||||
port: 587,
|
||||
secure: false,
|
||||
requireTLS: true,
|
||||
name: 'acatlan.unam.mx',
|
||||
pool: true,
|
||||
maxConnections: 1,
|
||||
maxMessages: 100,
|
||||
rateDelta: 2000,
|
||||
rateLimit: 1,
|
||||
});
|
||||
|
||||
const gmail = (subject, to, text) => {
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
send({ subject, to, text }, (error, result, fullResult) => {
|
||||
if (error) reject(error);
|
||||
resolve(result);
|
||||
});
|
||||
const gmail = (subject, to, text) =>
|
||||
transporter.sendMail({
|
||||
from: process.env.USER_GMAIL,
|
||||
to,
|
||||
subject,
|
||||
text,
|
||||
});
|
||||
|
||||
|
||||
// return "envio de correo"
|
||||
|
||||
|
||||
};
|
||||
|
||||
module.exports = gmail;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user