enviar qr y html
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user