the banner edit is ready and name of participant its getting update in eache event

This commit is contained in:
JorgeMike
2023-03-26 19:16:06 -06:00
parent e098a52fd8
commit 7a712928bd
11 changed files with 74 additions and 41 deletions
+1 -1
View File
@@ -35,7 +35,7 @@ export class EmailController {
if(!file) {
throw new HttpException("No se ha cargado ningun archivo", HttpStatus.BAD_REQUEST)
}
console.log(file)
/* console.log(file) */
return this.emailService.sendConstancias(file, nombreEvento);
}
}
+3 -19
View File
@@ -58,7 +58,7 @@ export class EmailService {
}
async sendConstancias(file, nombreEvento) {
console.log(file)
/* console.log(file) */
const workbook = xlsx.read(file.buffer);
const worksheet = workbook.Sheets[workbook.SheetNames[0]];
const data = xlsx.utils.sheet_to_json(worksheet);
@@ -68,22 +68,6 @@ export class EmailService {
const page = pdfDoc.addPage();
page.setSize(792, 612);
page.drawRectangle({
x: 0,
y: page.getHeight() - 60,
width: page.getWidth(),
height: 60,
color: rgb(0 / 255, 61 / 255, 121 / 255),
});
page.drawRectangle({
x: 0,
y: 0,
width: page.getWidth(),
height: 60,
color: rgb(213 / 255, 159 / 255, 15 / 255),
});
const font = await pdfDoc.embedFont(StandardFonts.HelveticaBold);
const fontSize = 30;
const text = 'Constancia de asistencia';
@@ -126,8 +110,8 @@ export class EmailService {
const url = URL.createObjectURL(blob); */
this.transporter.sendMail({
to: row.Email,
subject: 'Constancia de asistencia',
text: 'Hola',
subject: `Constancia de asistencia a "${nombreEvento}"`,
text: `¡Un saludo ${row.Nombre}! Aquí está tu constancia de asistencia por el evento "${nombreEvento}". Agradecemos tu asistencia y constancia, esperamos seguir viéndote en eventos futuros.`,
attachments: [attachment],
});
}