Attachments
An email template can carry PDF files. Each file is listed on the template and saved with it.
Attachments are part of the Engagement module. Ask your account team to enable Engagement for a workspace.
Add an attachment
- Open an email template in the editor.
- Click the paperclip at the top right of the canvas. It reads Attachments, or the number of files already on the template.
- In the Attachments panel, click Add attachment.
- Under Upload, drop a PDF or click to choose one.
- Change File name if the recipient should see a different name.
- Under When it cannot be attached, choose Required or Optional.
- Click Add, then save the template.
The file is stored when you click Add. It becomes part of the template only when you save the template. To remove a file, click Delete on its row and save.
Attach a file from the profile
A file can also come from each person’s profile, such as a monthly statement stored at a different address for every customer.
- In Add attachment, choose From profile.
- In Link, type the attribute that holds the file’s address, such as
{{ statement_url }}, or type/to pick it. - In File name, type the name the recipient sees. It can use merge tags, such as
statement-{{ month }}.pdf. - Choose Required or Optional, click Add, then save the template.
The panel lists the file as From profile with the attribute it reads.
The link must start with https:// or with a merge tag that holds an https:// address. When you save, the link and the file name are checked in the template’s language, the same way the subject is. A link that starts with http://, or a merge tag that is not closed, is refused and the reason is shown. A link can be at most 2,048 characters, and it cannot hold spaces or line breaks outside its merge tags.
When you change a template’s language, its links and file names from the profile are checked again in the new language, and the change is refused if one of them cannot be read in it.
Attach a document
A document can be attached to a template, so each person receives their own PDF, filled from their profile.
- In Add attachment, choose Document.
- In Document, pick the document. Only published documents are listed.
- File name starts as the document’s name. It can use merge tags, such as
statement-{{ first_name }}.pdf. The file is always sent as a PDF, so a name that does not end in.pdfgets.pdfadded. - Choose Required or Optional, click Add, then save the template.
The panel lists the file as Document with the document’s name.
The document must read the same data model as the template. A document on another model shows This document reads a different data model. and cannot be added. A template with no data model cannot attach a document. A draft document cannot be attached, and a document that a template attaches cannot be deleted. A template keeps its documents only while it stays on their data model: moving it to another data model, or basing it on an event, is refused until those documents are removed.
When a campaign is sent, it uses the document’s version published at that moment. Publishing a new version while a send is running does not change that send’s PDFs; the next send uses the new version. Each person’s PDF is made for their message alone and is not stored.
When a person’s PDF cannot be made, it is tried once more in the same send. If it still cannot be made, Required and Optional work as they do for a file from the profile: with Required, that person is not sent the message and is counted as withheld as Document failed to render; with Optional, they are sent the message without the PDF. Preview as customer lists the document’s file, under that customer’s file name, as Ready while the document has a published version.
How a file from the profile is sent
When a transactional campaign sends, each person’s link is filled in from their profile and the file is fetched for that person’s message alone. It is not stored.
- The address must be a public
https://address. Addresses on private networks are never fetched, and neither is a redirect to one. - The file must be a PDF of at most 5 MB.
- When File name is empty, the file is named after the last part of the link.
When a person’s file cannot be fetched, is too large or is not a PDF:
| Choice | What happens |
|---|---|
| Required | That person is not sent the message. The others are. |
| Optional | That person is sent the message without the file. |
Who was not sent a message
A person held back over a Required file or document is counted as withheld, neither sent nor failed. The campaign’s Insights tab shows how many people were withheld for each reason:
| Reason | Why |
|---|---|
| Attachment unavailable | The file could not be fetched or read, or the person’s link is empty. |
| Attachment too large | The file is larger than 5 MB, or the message is larger than the delivery partner allows. |
| Attachment not a PDF | The link served a file that is not a PDF. |
| Document failed to render | The person’s document could not be made, even when tried again. |
Preview a template’s attachments
In the template editor, click Preview, then Preview as customer and pick a customer. Under the preview, Attachments lists each file for that customer:
| Status | Meaning |
|---|---|
| Ready | The file can be attached. Its size is shown, and Open opens it. |
| No value | This customer’s link is empty. |
| Unavailable | The file could not be fetched or read, or it is not a PDF. |
| Too large | The file is larger than 5 MB. |
A file from the profile is fetched only when you preview as a customer, never while you type.
Attachments on a proof
A proof from the campaign’s Test & proof step carries the template’s attachments. Each file is filled in from the template’s sample values and the values you type for the proof, once, and the same files go to every address on the seed list.
After the proof, Attachments lists each file as Attached, or why it did not go. When a Required file cannot be had, no address is sent the proof, and each one shows why.
Limits
| Rule | Limit |
|---|---|
| File type | PDF only |
| File size | 5 MB per file |
| Files per template | 5 |
| File name | 255 characters, no slashes, control characters or invisible formatting characters |
A file that is not a PDF is refused with Only PDF files can be attached., even when its name ends in .pdf.
Each delivery partner also limits the size of one message, attachments included:
| Partner | Largest message |
|---|---|
| SendGrid | 30 MB |
| Mailjet | 15 MB |
| Infobip | 20 MB |
| Brevo | 10 MB |
A person whose message would be larger than the partner allows is not sent it.
Brevo accepts a file only when its name has an extension, so a file sent through Brevo whose name has none gets .pdf added. The other partners send the name as it is.
Attachments on a variant
A variant of a template sends the template’s attachments unless you give it its own.
- Open the template and pick the variant from the variants menu at the top right of the canvas.
- Click the paperclip.
- Turn off Use the template’s attachments. The variant’s list starts as a copy of the template’s.
- Add or delete files, then click Save variant.
The variant’s own list replaces the template’s whole list; it does not add to it. To make the variant send the template’s attachments again, turn Use the template’s attachments back on and save the variant.
Exported and imported templates
A template exported to a file keeps its list of attachments, but not the files themselves. When you import the file, attachments from the profile are kept. An uploaded file is kept only when the workspace you import into already holds it; otherwise it is left out, and the import report names it.
Required and optional
| Choice | Meaning |
|---|---|
| Required | The message is not sent without this file. |
| Optional | The message is sent without this file when it cannot be attached. |
New attachments are Required unless you choose otherwise.
Which messages carry attachments
Only transactional campaigns, such as an order receipt or a statement, carry a template’s attachments.
- A promotional campaign cannot use a template that has attachments. The campaign’s Message step lists the template’s attachments and shows Attachments need a transactional campaign. until you make the campaign transactional or pick another template.
- A campaign that becomes promotional, or whose template gains an attachment after it was saved, is refused when it is sent or armed.
- A journey’s Send message tile cannot use a template that has attachments.
Event-fired campaigns
A transactional campaign sent when an event arrives carries the template’s attachments, the same way a campaign sent to an audience does. A person whose Required file cannot be had is not sent the message. They are counted as withheld with the reason, on the campaign’s Insights tab and in the Delivery withheld report.
WhatsApp document headers
A WhatsApp template whose header is a document sends a PDF with each message. On the campaign’s message step, under Header, the Header document slot offers three choices:
| Choice | What each person gets |
|---|---|
| Attribute | Their own file, from an attribute that holds an https:// link to it. |
| Upload | The PDF you upload, the same for everyone. |
| Document | Their own PDF, made from a published document. |
- With Upload, drop a PDF of at most 5 MB. Each message carries a link to that file which stops working 24 hours after the send starts. If the file is no longer there when the send starts, nobody is sent the message, and everyone is counted as withheld as Attachment unavailable.
- With Attribute, each person’s link is checked before the message goes: it must be a public
https://address serving a PDF of at most 5 MB. The file is named after the last part of the link. - A person whose link is empty, cannot be fetched, is too large or is not a PDF is not sent the message, and is counted as withheld with the reason.
- With Document, pick a published document. Each person’s PDF is made from their own data and named after the document. Their message carries a private link to it, which stops working 24 hours after it is made, and the file is deleted 48 hours after it is made. A person whose document cannot be made is not sent the message and is counted as failed, under Document failed to render. A document a WhatsApp header uses cannot be deleted.
Who can add attachments
Anyone who can edit email templates can add and remove attachments. Members who can only view templates cannot change them. Binding a WhatsApp document header needs permission to edit campaigns and WhatsApp templates.