personalización de correo

This commit is contained in:
Andres2908
2022-03-17 11:57:25 -06:00
parent 82b0d07c5c
commit 591905d20e
2 changed files with 4 additions and 4 deletions
@@ -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:
+2 -2
View File
@@ -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);
});