correo declinar

This commit is contained in:
Andres2908
2022-05-16 22:16:35 -05:00
parent ccd18dfe77
commit fb26d8adf7
2 changed files with 38 additions and 1 deletions
+16 -1
View File
@@ -1,9 +1,22 @@
const { validarNumeroEntero } = require('../../helper/validar');
const {
validarNumeroEntero,
validarNumeroCuenta,
} = require('../../helper/validar');
const dbPath = '../../db/tablas';
const Inscripcion = require(`${dbPath}/Inscripcion`);
const gmail = require('../../helper/gmail');
const correoDeclinar = require('../../helper/correoDeclinar');
const validarTicket = async (body) => {
const folio = validarNumeroEntero(body.folio, 'folio', true);
const numeroCuenta = validarNumeroCuenta(
body.numeroCuenta,
'número de cuenta',
true
);
let correo = {};
let email = '';
return Inscripcion.findOne({
where: { folio },
@@ -33,6 +46,8 @@ const validarTicket = async (body) => {
})
.then((res) => {
if (body.validacion === 0) {
email = `${numeroCuenta}@pcpuma.acatlan.unam.mx`;
correoDeclinar = correoInscripciones();
return Inscripcion.update(
{ motivo: body.motivo },
{