token correos

This commit is contained in:
jorgemike
2025-06-28 19:07:08 -06:00
parent 551cc3e3b2
commit 1732065ced
2 changed files with 42 additions and 24 deletions
@@ -273,31 +273,39 @@ export class CuestionarioRespondidoService {
);
}
await axios.post(`${urlApiCorreos}/mail/send`, {
to: participante.correo,
subject: `Evento: ${cuestionario.evento?.nombre_evento}`,
fecha_recibido: '2025-03-10T12:00:00Z',
html: generarHtmlCorreoAsistencia({
nombreForm: cuestionario.nombre_form,
nombreEvento: cuestionario.evento?.nombre_evento,
correo: participante.correo,
fechaRegistro: new Date().toLocaleString(),
fechaInicioEvento: cuestionario.evento?.fecha_inicio
? new Date(cuestionario.evento.fecha_inicio).toLocaleString()
: undefined,
fechaFinEvento: cuestionario.evento?.fecha_fin
? new Date(cuestionario.evento.fecha_fin).toLocaleString()
: undefined,
}),
adjuntos: [
{
filename: 'qr.png',
content: qrBuffer.toString('base64'),
encoding: 'base64',
cid: 'qrCode',
await axios.post(
`${urlApiCorreos}/mail/send`,
{
to: participante.correo,
subject: `Evento: ${cuestionario.evento?.nombre_evento}`,
fecha_recibido: '2025-03-10T12:00:00Z',
html: generarHtmlCorreoAsistencia({
nombreForm: cuestionario.nombre_form,
nombreEvento: cuestionario.evento?.nombre_evento,
correo: participante.correo,
fechaRegistro: new Date().toLocaleString(),
fechaInicioEvento: cuestionario.evento?.fecha_inicio
? new Date(cuestionario.evento.fecha_inicio).toLocaleString()
: undefined,
fechaFinEvento: cuestionario.evento?.fecha_fin
? new Date(cuestionario.evento.fecha_fin).toLocaleString()
: undefined,
}),
adjuntos: [
{
filename: 'qr.png',
content: qrBuffer.toString('base64'),
encoding: 'base64',
cid: 'qrCode',
},
],
},
{
headers: {
token: process.env.SYSTEM_TOKEN_API_CORREOS,
},
],
});
},
);
console.log(`Correo enviado exitosamente a ${participante.correo}`);
} catch (error) {