feat: add email sending functionality for Scheda Annuncio with updated subject and recipient
This commit is contained in:
parent
8c6f01a8b1
commit
eaee6246a5
1 changed files with 22 additions and 0 deletions
|
|
@ -90,6 +90,28 @@ export const comunicazioniRouter = createTRPCRouter({
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
await NewMail({
|
||||||
|
template: {
|
||||||
|
mailType: "emailSchedaContatto",
|
||||||
|
props: {
|
||||||
|
nominativo: input.nominativo,
|
||||||
|
telefono: input.numero,
|
||||||
|
indirizzo: input.indirizzo,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
mail: {
|
||||||
|
subject: `Ric. invio Scheda ${input.codice} a ${input.to}`,
|
||||||
|
to: "web@infoalloggi.it",
|
||||||
|
attachments: [
|
||||||
|
{
|
||||||
|
filename: `scheda annuncio ${input.codice}.pdf`,
|
||||||
|
content: base64Content,
|
||||||
|
encoding: "base64",
|
||||||
|
contentType: "application/pdf",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
});
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
throw new Error(
|
throw new Error(
|
||||||
`Errore nell'invio dell'email: ${(e as Error).message}`,
|
`Errore nell'invio dell'email: ${(e as Error).message}`,
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue