feat: add email notification for new payment received with PDF receipt attachment
This commit is contained in:
parent
b496aa5d75
commit
237ecec27e
1 changed files with 31 additions and 0 deletions
|
|
@ -266,6 +266,37 @@ export const whIntentSucceededHandler = async ({
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
await addEventToQueue({
|
||||||
|
data: {
|
||||||
|
tipo: "email",
|
||||||
|
data: {
|
||||||
|
template: {
|
||||||
|
mailType: "generic",
|
||||||
|
props: {
|
||||||
|
title: "Nuovo pagamento ricevuto",
|
||||||
|
testo: `È stato ricevuto un nuovo pagamento.`,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
mail: {
|
||||||
|
subject: "Ric pagamento",
|
||||||
|
to: "web@infoalloggi.it",
|
||||||
|
attachments: [
|
||||||
|
{
|
||||||
|
filename: `ricevuta_cortesia_${ordine.ordine_id}.pdf`,
|
||||||
|
|
||||||
|
generate: {
|
||||||
|
type: "ricevuta_cortesia",
|
||||||
|
ordineId: ordine.ordine_id,
|
||||||
|
},
|
||||||
|
encoding: "base64",
|
||||||
|
contentType: "application/pdf",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
lock_expires,
|
||||||
|
});
|
||||||
});
|
});
|
||||||
return true;
|
return true;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue