nova-crm
2
TS invoiceMailer.ts
{} package.json
36 /** Send the rendered invoice to the customer’s billing address. */
37 async send(invoice: Invoice): Promise<void> {
38 const pdf = await renderInvoicePdf(invoice);
39 const to = invoice.customer.billingEmail;
40
41 // One retry on transient SMTP failure — then surface to the queue.
42 await this.transport.sendMail({
43 to,
44 subject: `Invoice ${invoice.number} from Nova`,
45 attachments: [{ filename: `${invoice.number}.pdf`, content: pdf }],
46 });
47
48 await this.audit.record('invoice.sent', { id: invoice.id, to });
49 }
50
51 /** Overdue reminders batch through the same path (digestJob). */
52 async sendReminder(invoice: Invoice): Promise<void> {
53 const days = overdueDays(invoice);
54 if (days < 7) return;
55 // …
main
0 0
62 +3 · 2
Ln 42, Col 5
Spaces: 2
UTF-8
TypeScript