Send documents to customers with PDF attachments.
Send
// title: Send invoice email
await sdk.email.send(invoice.id, {
to: "customer@example.com",
subject: "Invoice #{document_number}",
body: "Please find your invoice attached.",
});Uses the entity’s default template.
Custom Template
// title: Custom email template
await sdk.email.send(invoice.id, {
to: "billing@acme.com",
cc: "accounts@acme.com",
subject: "Invoice {document_number} from {entity_name}",
body: `Hi {customer_name},
Please find invoice **{document_number}** attached.
**Amount due:** {total_with_tax} {currency_code}
**Due date:** {due_date}
View online: {invoice_link}
Thank you for your business!`,
});Variables: {document_number}, {customer_name}, {entity_name}, {total}, {invoice_link}.