
The **Send Email** node allows you to communicate with your customers through emails based on events and other conditions defined in a workflow.  

When a workflow that contains this node is launched, an email campaign is created as a result. You can find its statistics in the **Experience Hub**  as well as in the **Send Email** node itself. 

The configuration of the node requires:
- selecting an email account from which the message will be sent, 
- selecting an email template or creating a new one from scratch,
- defining the subject of the email (which displays in the recipient's inbox)

Optionally, you can:

- define UTM parameters, URL parameters, custom parameters;
- send a test email,
- add static attachments (for example, terms and conditions, instructions, and so on) which do not contain dynamic elements generated for an individual customer,
- add [dynamic attachments](#dynamic-attachments) (for example, documents dedicated for an individual customer)
    - Allowed formats: `.png`, `.jpg`, `.pdf`
    - Maximum size of all attached files in the **Send Email** node is 10MB
    - Allowed size of attachments in a workflow: 20MB


## Dynamic attachments
---
Dynamic attachments is a feature that lets you send tailored attachments through emails to each customer. 

### Providing dynamic attachment to Synerise

To be able to send dynamic attachments by means of the **Send Email** node, you must integrate your system that generates files dedicated to customers and upload them to Synerise through the [Synerise API](https://developers.synerise.com/AssetManagement/AssetManagement.html#operation/addClientFiles) (with content encoded in base64).  

When the request is successful, an [`attachment.upload`](/docs/assets/events/event-reference/automation#attachmentupload) event is generated in the context of a specific customer. While decoding the file or files, they are scanned to detect any malicious content. The file time to live is configurable and by default it is 30 days.

### Adding a file to the workflow 

To use a dynamic file or files uploaded to Synerise, you must use an [`attachment.upload` event](/docs/assets/events/event-reference/automation#attachmentupload) and its parameters to specify an event from which the file or files will be sourced. If the [`attachment.upload` event](/docs/assets/events/event-reference/automation#attachmentupload) contains more than one file, all of them will be included.

1. Use the [`attachment.upload` event](/docs/assets/events/event-reference/automation#attachmentupload) in a workflow (for example, in the **Profile Event** trigger).
2. In the settings of the node that contains this event: 
    - enter a unique title
    - by using the event parameters, identify a specific event from which you want to source the file/files.  
      There is no possibility to select specific files out of the event.    
4. Add the **Send Email** node to the workflow. In the configuration of the node, from the **Dynamic attachment** dropdown list, select the node from which the dynamic file/files will be sourced.  
    All files from the [`attachment.upload` event](/docs/assets/events/event-reference/automation#attachmentupload) in the selected node will be attached. 

<figure><img src="/api/docs/image/54176ad07f146575310749eba44b7c2f42c1b327/docs/automation/_gfx/dynamic-attachment.png" class="large" alt="Dynamic attachment field"><figcaption>List of nodes from which the attachment can be sourced</figcaption></figure>

### Event information


<div class="admonition admonition-note"><div class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2.5"><path stroke-linecap="round" stroke-linejoin="round" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" /></svg></div><div class="admonition-body"><div class="admonition-content">

To see the event reference related to attachment upload events, click [here](/docs/assets/events/event-reference/automation).

</div></div></div>


- When the file is uploaded to Synerise, an [`attachment.upload` event](/docs/assets/events/event-reference/automation#attachmentupload) is generated on the customer's profile. 
- You can send several requests with a single file or one request with up to 5 files. 
    
  <div class="admonition admonition-important"><div class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2.5"><path stroke-linecap="round" stroke-linejoin="round" d="M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" /></svg></div><div class="admonition-body"><div class="admonition-content">

  In the case of sending several files in one request, the order of the files matter.

  </div></div></div>

- On the user interface, the attachment parameter names will be preceded by the `attachment.[number].` prefix. 
- You can add your own custom parameters in the request body which will let you easily indicate a particular file you want to use.  
- When the request for uploading the file or files to Synerise is unsuccessful, the [`attachment.failed` event](/docs/assets/events/event-reference/automation#attachmentfailed) is generated on the customer's profile.
- When the file expires, the [`attachment.expired` event](/docs/assets/events/event-reference/automation#attachmentexpired) is generated on the customer's profile.



<details class="accordion"><summary>Click here to expand the attachment.upload event raw data with one file</summary><div class="accordion-content"><pre><code class="language-JSON">{ "action": "attachment.upload", "eventUUID": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "unique": null, "createDate": 1690540914606, "label": "Attachments uploaded", "params": { "attachment.0.size": 35, "attachment.0.filename": "mysamplefile.csv", "attachment.0.extension": "csv", "attachment.0.mimeType": "text/csv", "attachment.0.id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "attachments": [ { "mimeType": "text/csv", "id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "minioBucketName": "c87e604e446098039e47861c04f082d268c1e5d3", "filename": "mysamplefile.csv", "extension": "csv", "path": "/ac584986810501a8387e41ccb794a3bf4cc4750a/709fe9f6-4d19-4e72-a406-5e20fb824bda", "size": 35 } ] } }</code></pre></div></details>


<details class="accordion"><summary>Click here to expand the attachment.upload event raw data with several files</summary><div class="accordion-content"><pre><code class="language-JSON">{ "action": "attachment.upload", "eventUUID": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "unique": null, "createDate": 1690540956960, "label": "Attachments uploaded", "params": { "attachment.1.filename": "file2.csv", "attachment.0.size": 35, "attachment.0.extension": "csv", "attachment.2.size": 35, "attachment.0.mimeType": "text/csv", "attachment.1.id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "attachment.2.extension": "csv", "attachment.2.filename": "file3.csv", "attachment.1.mimeType": "text/csv", "attachment.1.extension": "csv", "attachment.2.mimeType": "text/csv", "attachment.0.filename": "file1.csv", "attachment.0.id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "attachments": [ { "mimeType": "text/csv", "id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "minioBucketName": "c87e604e446098039e47861c04f082d268c1e5d3", "filename": "file1.csv", "extension": "csv", "path": "/ac584986810501a8387e41ccb794a3bf4cc4750a/aab5fe6b-e14e-432c-ab79-fce47c0761e0", "size": 35 }, { "mimeType": "text/csv", "id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "minioBucketName": "c87e604e446098039e47861c04f082d268c1e5d3", "filename": "file2.csv", "extension": "csv", "path": "/ac584986810501a8387e41ccb794a3bf4cc4750a/aab5fe6b-e14e-432c-ab79-fce47c0761e0", "size": 35 }, { "mimeType": "text/csv", "id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "minioBucketName": "c87e604e446098039e47861c04f082d268c1e5d3", "filename": "file3.csv", "extension": "csv", "path": "/ac584986810501a8387e41ccb794a3bf4cc4750a/aab5fe6b-e14e-432c-ab79-fce47c0761e0", "size": 35 } ], "attachment.1.size": 35, "attachment.2.id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" } }</code></pre></div></details>




## Node requirements
---
- [Create an email account](/docs/campaign/e-mail/configuring-email-account) which you will use to send emails.  
  More details about configuring and managing emails are available in ["Email"](/docs/campaign/e-mail).
- If you plan to use [dynamic attachments](#dynamic-attachments) to your emails, you must prepare a service that generates files encoded in base64 and send them to this [endpoint](https://developers.synerise.com/AssetManagement/AssetManagement.html#operation/addClientFiles). These files cannot be protected with a password.


## Node configuration
---

1. To create a workflow that lets you send emails to your customers, go to **Automation Hub > Workflows > New workflow**.  
2. Select one of the profile trigger nodes, for example [Profile Event](/docs/automation/triggers/client-event-node).  
3. Click **THEN > Send Email**.  
4. To open the configuration form of the node, click it.
5. Optionally, next to the node name, you can add a custom node title which will be displayed on the node.
6. If you want to assign a tag to the email campaign you will send through the workflow, under the node title, click **Add tag**.  
7. From the dropdown list, select the [tag](/docs/assets/tags).  
    The list contains only the tags which are available in the predefined **campaigns** tag folder. 
    
   <div class="admonition admonition-tip"><div class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2.5"><path stroke-linecap="round" stroke-linejoin="round" d="M9.663 17h4.673M12 3v1m6.364 1.636l-.707.707M21 12h-1M4 12H3m3.343-5.657l-.707-.707m2.828 9.9a5 5 0 117.072 0l-.548.547A3.374 3.374 0 0014 18.469V19a2 2 0 11-4 0v-.531c0-.895-.356-1.754-.988-2.386l-.548-.547z" /></svg></div><div class="admonition-body"><div class="admonition-content">

   Assigning tags helps you organize your communications by categorizing campaigns across different channels. Additionally, you can control [communication limits](/docs/settings/configuration/campaign-limits) by applying restrictions to these tags.

   </div></div></div>


### Select sender account
---
In this part of the node configuration, you will define the email account from which the message will be sent and define the email address to which the recipients can send replies. 

<figure><img src="/api/docs/image/54176ad07f146575310749eba44b7c2f42c1b327/docs/automation/_gfx/sender-details.png" class="large" alt="The Sender Details section is filled out by default"><figcaption>The Sender Details section is filled out by default</figcaption></figure>

2. In the **Sender details** section, perform the following actions:
    1. In the **From email address**, from the dropdown list, select an email account from which the email is sent. 
    2. In the **From name**, enter the name of the sender that is displayed in the inbox.
    3. In the **Reply to email address**, enter the email address to which the responses to the email are delivered. [Dynamic values](/developers/inserts) are allowed in this field.
    4. In the **Reply to name**, enter the name of the receiver of responses. [Dynamic values](/developers/inserts) are allowed in this field.
    5. Confirm the settings in this section by clicking **Apply**.

### Prepare email content
---
In this part of the node configuration, you will define the email subject that will be displayed in the recipient's inbox and create the content of the message.  

<figure><img src="/api/docs/image/54176ad07f146575310749eba44b7c2f42c1b327/docs/automation/_gfx/email-content.png" class="large" alt="The Content section in the Send Email node"><figcaption>The Content section in the Send Email node</figcaption></figure>

3. In the **Content** section, click **Define**.
    1. In the **Subject** field, enter the subject of the email that is shown in the inbox.
    2. Optionally, by clicking <img src="/api/docs/image/54176ad07f146575310749eba44b7c2f42c1b327/icons/snippet-icon.png" alt="Snippet icon" class="icon" > you can select a [snippet](/docs/assets/snippets) which will let you personalize the message subject. 
    2. If you want to:  
        - Select an email template, click **Create message**. From the list of the templates, select the one you want to use.  
          - If you make changes to the template, click **Save** and then **Use in node**.
          - If you don't make changes to the template, click **Use in node**.
        - Create a message from scratch, click **Create message > New template**. The template will be available only in this node for preview and modifications.
          1. Select one of the builders you want to use to create a message: [email template builder](/docs/campaign/e-mail/creating-email-templates/email-code-editor) or [basic drag&drop builder](/docs/campaign/e-mail/creating-email-templates/creating-custom-html-block-basic-builder). You can also [import email templates](/docs/campaign/e-mail/importing-email-templates) to an email builder.
          2. After finishing the template, click **Use in node**.  
2. Confirm settings in the section by clicking **Apply**. 
         
    

### Adding attachments
---
In this part of the node configuration, you will add a static attachment or a [dynamic attachment](/docs/automation/actions/send-email#dynamic-attachments). This part is optional.

1. In the **Attachment** section, click **Define**.
2. To add a static attachment, in the **Attachment** field, upload a file from your device. 
        This file will be sent with the email when a profile arrives at this node.
5. To add a dynamic attachment, from the **Dynamic Attachment** dropdown list, select the title of the node from which this file will be sourced.  
        
   <div class="admonition admonition-important"><div class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2.5"><path stroke-linecap="round" stroke-linejoin="round" d="M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" /></svg></div><div class="admonition-body"><div class="admonition-content">

   The list will be empty if there is no reference to an [`attachment.upload` event](/docs/assets/events/event-reference/automation#attachmentupload) in any preceding node and/or the node with this event has no title.

   </div></div></div>


3. Confirm by clicking **Apply**.

### Adding UTM and URL parameters
---
In this part of the node configuration, you will define UTM and URL parameters that will be added to the email campaign launched with the start of the workflow. This part is optional.  

<figure><img src="/api/docs/image/54176ad07f146575310749eba44b7c2f42c1b327/docs/automation/_gfx/utm-url-parameters.png" class="large" alt="The UTM & URL parameters section in the Send Email node"><figcaption>The UTM & URL parameters section in the Send Email node</figcaption></figure>

4. In the **UTM & URL parameters** section:  
    - To omit this step, click **Skip step**. Otherwise, you won't be able to save the workflow with this empty section.
    - To add UTM and/or URL parameters, click **Define**.
        1. Fill in the following fields: **UTM campaign**, **UTM medium**, **UTM source**, and **UTM term**.
        2. To add URL parameters, in the **URL parameters** section, click **Add parameter**. 
        3. Enter values for the **Parameter** and **Value** fields.
        2. Confirm by clicking **Apply**.


### Adding additional parameters
---
If you want to add the custom event parameters with constant values to the automatically generated events in the email channel, in the **Additional parameters** section, click **Define**. Add additional parameters according to the instructions in the ["Adding custom parameters"](/docs/campaign/e-mail/creating-email-campaigns#adding-custom-parameters) section.  

This part is optional.

### Sending a test email
---
In this part of the node configuration, you can send a test email to users available in [Behavioral Data Hub](/docs/crm/crm-profile) or any external email address. This part is optional.  


<div class="admonition admonition-important"><div class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2.5"><path stroke-linecap="round" stroke-linejoin="round" d="M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" /></svg></div><div class="admonition-body"><div class="admonition-content">

The **View in browser** option is unavailable in the test emails sent through Automation Hub.

</div></div></div>


1. In the **Test email** section, click **Define**.
2. In the **Profiles** tab, enter the email address(es) to which you want to send a test message. 
3. Click **Add**.  
  **Result**: The list of email addresses you added is shown.  
  When you send a test message to a test user who is not added to **Behavioral Data Hub > Profiles** in Synerise, the [inserts](/developers/inserts) will not display in the message.

4. When your message is ready to be sent, in the upper right corner of the section, click **Send test**. 

### Defining additional node settings
---

4. To impose a limit on the action, switch the **Action limit** toggle. Enter a number and from the dropdown list, select the time unit. You can define how many times this action can be executed for the whole automation process (**workflow**), or you can define how many times per second/minute/hour/day/week/month can be executed.
4. If you want to make sure that this message is sent to a customer, even it exceeds the global limit of this type of messages for a single customer per day (more information is available [here](/docs/settings/configuration/campaign-limits)), enable the **Ignore limits** toggle. You may apply it to system messages such as a transaction confirmation, notifications about order delays, and so on.
3. If you want to exclude customers who belong to [global control group](/docs/settings/configuration/global-control-group) from the recipients, enable the **Enable Global Control Group** option.
7. Confirm by clicking **Apply**. 

## Example of use
---
The purpose of the scenario is to control the number of vouchers granted to users who spend over $100 in an online shop. If the number of vouchers is exceeded, future customers who spend more than $100 get an email with information that the promotion has finished. 


<figure>
<img src="/api/docs/image/54176ad07f146575310749eba44b7c2f42c1b327/docs/automation/_gfx/metric-filter-node-example.png" alt="Example of use" class="full">
<figcaption>Example of an automation process that uses the Send Email action </figcaption>
</figure>

1. The scenario starts with a **Profile Event** trigger in which the required transaction amount is more than $100.
2. The [Metric Filter](/docs/automation/conditions/metric-filter-node) contains a metric that counts the number of emails with a discount code. The maximum value defined in the condition is 1000.
3. When the customer makes a purchase:
    1. If the value defined in the condition is not exceeded, the customer follows the path in which the email with voucher code is sent. 
    2. If the value defined in the condition is exceeded, the customer receives an email with information that the voucher pool just run out. 
4. When an email is sent, the process is completed. 

## Example of use with dynamic attachment
---
The purpose of the scenario is to trigger a workflow when an insurance document is generated for a specific customer. Then the email is sent with the generated insurance document for this customer.

1. Start with the **Profile Event** node. In the configuration of the node, select the `attachment.upload` event. Specify the file you want to attach by using the event parameters.
2. Add the **Send email** node. In the configuration of the node:  
    1. Fill out the configuration form as described in the [Node configuration](#node-configuration).
    2. From the **Dynamic attachment** dropdown list, select the title of the node from which the file will be sourced.
3. Add the **End** node.  
    **Result**:
    <figure><img src="/api/docs/image/54176ad07f146575310749eba44b7c2f42c1b327/docs/automation/_gfx/dynamic-attachment-example.png" class="full" alt="Example of use"><figcaption>Example workflow</figcaption></figure>
