personalización de correo
This commit is contained in:
@@ -26,7 +26,7 @@ const inscripcion = async (body, file) => {
|
||||
where: { idUsuario, idArea, cancelacion: 0 },
|
||||
}).then((res) => {
|
||||
if (res) throw new Error('Ya estas registrado en esta área');
|
||||
email = `419085500@pcpuma.acatlan.unam.mx`;
|
||||
email = `${body.numeroCuenta}@pcpuma.acatlan.unam.mx`;
|
||||
correo = correoInscripciones();
|
||||
if (file && folio && body.fechaTicket) {
|
||||
return Inscripcion.create({
|
||||
@@ -53,7 +53,7 @@ const inscripcion = async (body, file) => {
|
||||
.then((res) => {
|
||||
if (file)
|
||||
fs.renameSync(file.path, file.path + '.' + file.mimetype.split('/')[1]);
|
||||
gmail(correo.subject, email, correo.msj);
|
||||
return gmail(correo.subject, email, correo.msj);
|
||||
})
|
||||
.then((res) => ({
|
||||
message:
|
||||
|
||||
@@ -5,9 +5,9 @@ const send = require('gmail-send')({
|
||||
pass: process.env.GMAILPASSWORD,
|
||||
});
|
||||
|
||||
const gmail = (subject, to, text) => {
|
||||
const gmail = (subject, to, html) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
send({ subject, to, text }, (error, result, fullResult) => {
|
||||
send({ subject, to, html }, (error, result, fullResult) => {
|
||||
if (error) reject(error);
|
||||
resolve(result);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user