Correo incompleto

This commit is contained in:
Andres2908
2022-03-17 00:46:01 -06:00
parent 028cc45405
commit 82b0d07c5c
7 changed files with 127 additions and 61 deletions
@@ -2,7 +2,8 @@ const moment = require('moment');
const fs = require('fs');
const { validarNumeroEntero, validarNumero } = require('../../helper/validar');
const { eliminarArchivo } = require('../../helper/helper');
const { usuarioInscrito } = require('../../config/mariadb.conf');
const gmail = require('../../helper/gmail');
const correoInscripciones = require('../../helper/correo');
const dbPath = '../../db/tablas';
const Inscripcion = require(`${dbPath}/Inscripcion`);
@@ -13,6 +14,9 @@ const inscripcion = async (body, file) => {
const monto = validarNumero(body.monto, 'monto', true);
const folio = body.folio;
let correo = {};
let email = '';
return Inscripcion.findOne({
where: { folio },
})
@@ -22,6 +26,8 @@ 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`;
correo = correoInscripciones();
if (file && folio && body.fechaTicket) {
return Inscripcion.create({
idUsuario,
@@ -47,6 +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);
})
.then((res) => ({
message: