How to add attachments in email
In this document, we will explain how to add a single or multiple attachments in your email.
You can add static as well as dynamic attachments to emails
On clicking on the attach button (highlighted below) on the to right corner of the either Email editor, you will see:
-
Upload Files: Allows you to attach files from the system. This then stays as a static attachment in the body of the email and is sent along with the email as an attachment every time it’s triggered.
-
Dynamic Placeholders: Allows you to include dynamic files within the email, when the notification event is triggered. You can use placeholders to specify the:
- File Name - Provide a static value like ‘Invoice.pdf’ (if you are testing it manually) or a placeholder like
{{attachment.filename}}
(if your are triggering notification event via API) - Type - Select the file type from the dropdown or you can enter a placeholder like
{{attachment.filetype}}
You can see all the MIME types here - URL - Provide a static URL or Dynamic URL using a placeholder like
{{attachment.presigned_url}}
. The URL should be wither pre-signed or public URL.
- File Name - Provide a static value like ‘Invoice.pdf’ (if you are testing it manually) or a placeholder like
Placeholders should be used if the attachment information is dynamic (for instance, a personalized attachment depending on the recipient). Typically such attachments are sent via an API call. To send dynamic attachments in the event payload, make sure that the data
section of the payload has an object called attachment
as shown below.
In the above command:
How to add multiple attachments?
To add multiple attachments in email, add them in the placeholders as shown below.
- Filename -
{{attachment.0.filename}}
- File Type -
{{attachment.0.filetype}}
- Content -
{{attachment.0.presigned_URL}}