Email a document
send_document_emailSend an already issued invoice or proforma to the client via email with attached PDF. Use when the user requests to email or re-email a document.
Instructions
Send an invoice or proforma that already exists to the client by email, with the PDF attached by SmartBill. Use this when the user asks to send or resend a document.
Omit to, subject or bodyText to use the client's stored address and the templates configured in the SmartBill account — usually the right choice. Pass plain text for the subject and body; encoding is handled for you.
To email a document at the moment it is issued instead, set sendEmail: true on create_invoice or create_estimate rather than calling this afterwards. This sends real mail to a customer: confirm the recipient with the user first.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cc | No | Carbon copy address. | |
| to | No | Recipient address. | |
| bcc | No | Blind carbon copy address. | |
| number | Yes | Document number. | |
| subject | No | Plain text; encoded for the API automatically. | |
| bodyText | No | Plain text; encoded for the API automatically. | |
| seriesName | No | Document series. Falls back to the configured default. | |
| documentType | Yes | Which document to send. | |
| companyVatCode | No | Issuing company CIF. Falls back to SMARTBILL_VAT_CODE. |