enviar qr y html

This commit is contained in:
Your Name
2025-04-03 11:17:00 -06:00
parent 557beeab60
commit afa6743b47
2 changed files with 42 additions and 6 deletions
+10 -5
View File
@@ -31,7 +31,7 @@ export class MailController {
@ApiSendMail()
async sendMail(
@Headers() headers:{password:string},
@Body() body: { to: string; subject: string; text: string; fecha_recibido: Date }) {
@Body() body: { to: string; subject: string; text: string; fecha_recibido: Date, html:string, adjuntos:any }) {
/*
@@ -49,10 +49,15 @@ export class MailController {
throw new UnauthorizedException('Password incorrecto');
} */
const { to, subject, text, fecha_recibido } = body;
console.log("estos son los archivos adjuntos en el controller",body);
const result = await this.mailService.sendMail(to, subject, text, fecha_recibido,1); // sistem
const { to, subject, text, html, fecha_recibido, adjuntos } = body;
const result = await this.mailService.sendMail(to, subject, text,html, fecha_recibido,1,adjuntos); // sistem
return result;
@@ -84,7 +89,7 @@ export class MailController {
for (const email of await emails) {
try {
await this.mailService.sendMail(email, "subject", "text", fechaActual,sistem);
await this.mailService.sendMail(email, "subject", "text","html", fechaActual,sistem);
console.log(`📧 Enviado a: ${email}`);
} catch (error) {
console.error(`❌ Error enviando a ${email}:`, error.message);