Developers · Notifications and Email
Adding attachments to an email notification
Last updated 2 November 2026
This guide discusses how to attach files to an email notification.
Prerequisites
To understand this tutorial, it is necessary to understand the concept of email notifications. You are using the email notification created in a previous tutorial: Creating an Email Notification
Steps
Attaching a file to an Email Notification is a one-step process:
- Step 1: Include the 'attachments' JSON file in the Email Notification
Step 1: Include the 'attachments' JSON file in the Email Notification
Add the
app/emails/welcome_user.liquid
---
to: "{{ form.email }}"
from: "Platform <[email protected]>"
reply_to: [email protected]
subject: "Welcome to our platform, {{ form.first_name }} !"
layout: mailer
attachments: >
{
"logo.jpg": {
"url": "https://insites.io/images/logo.svg"
}
}
---
<h2>Hi {{ form.first_name }}!</h2>
<p>Welcome to our platform!</p>Now, the attachment will be included when you send an email.
You can use
{
"<file_name_user_will_see1>": {
"url": "<url to the attachment>"
},
"<file_name_user_will_see2>": {
"url": "<another url to the attachment>"
}
}You can also mark any attachment's
Inline attachment means that some types of files will be displayed inside the email content by some email clients.
By default, attachments have
{
"my_file": {
"url": "https://example.com/file.pdf",
"inline": "true"
}
}Note
You can include up to 9 attachments. Note that the total size must not exceed 20MB.
Next Steps
Congratulations! You have sent an Email Notification with an attachment. Now you can learn about creating an SMS Notification: Creating an SMS Notification