feat: add email sending functionality for Scheda Annuncio with updated subject and recipient

This commit is contained in:
Marco Pedone 2026-02-17 12:38:42 +01:00
parent 8c6f01a8b1
commit eaee6246a5

View file

@ -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}`,