Email Sender
In this article
Overview
You can use this Snap to send email messages to an SMTP server in plain text and HTML format. You can also format an HTML table and fill the rows by using data from the input view.
You can send emails anonymously if your SMTP server allows it. You may leave the Email ID and Password fields empty in that case. You might have to set the Secure connection to 'NONE' if your SMTP server requires. Learn more about setting up this type of account.
If your pipeline results in no data being sent to this Snap, no email will be sent.
Snap Type
Email Sender Snap is a Write-type Snap.
Prerequisites
This Snap requires a valid SMTP account to handle access to this endpoint.
Support for Ultra Pipelines
Works in Ultra Pipelines if batching is disabled.
Supported Versions
Supports TLS version 1.2.
Limitations and Known Issues
None.
Snap Views
Type | Format | Number of Views | Examples of Upstream and Downstream Snaps | Description |
---|---|---|---|---|
Input | Document
|
| Email Reader | Each document may contain Map data with values for JavaScript expression in the properties and/or data for the HTML table rows.
|
Output | Document |
| Mapper | Each document contains a Map data which represents one successfully-sent email message. The following is an example of an output document:
|
Error | Error handling is a generic way to handle errors without losing data or failing the Snap execution. You can handle the errors that the Snap might encounter while running the Pipeline by choosing one of the following options from the When errors occur list under the Views tab. The available options are:
Learn more about Error handling in Pipelines. |
Snap Settings
Asterisk (*): Indicates a mandatory field.
Suggestion icon (): Indicates a list that is dynamically populated based on the configuration.
Expression icon (): Indicates whether the value is an expression (if enabled) or a static value (if disabled). Learn more about Using Expressions in SnapLogic.
Add icon (): Indicates that you can add fields in the fieldset.
Remove icon (): Indicates that you can remove fields from the fieldset.
Field Name | Field Type | Description |
---|---|---|
Label* Default Value: Email Sender | String | Specify the name for the Snap. You can modify this to be more specific, especially if you have more than one of the same Snap in your Pipeline.
|
To* Default Value: None | String/Expression | Specify the email addresses of to-type recipients, its exact format including the address separator may be email-server dependent. It may contain JavaScript expression to be substituted with the data from the input view.
|
CC Default Value: None | String/Expression | Specify the email addresses of cc-type (carbon copy) recipients, its exact format including the address separator may be email-server dependent. It may contain JavaScript expression to be substituted with the data from the input view. |
Bcc Default Value: None | String/Expression | Specify the email addresses of bcc-type (blind carbon copy) recipients, its exact format including the address separator may be email-server dependent. It may contain JavaScript expression to be substituted with the data from the input view. |
From Default Value: N/A | String/Expression | Specify the email address of the sender. If there are multiple senders then separate them with a comma. The exact format of the email address including the address separator is email-server dependent. The format may contain a JavaScript expression that must be substituted with the data from the input. Email systems like Microsoft Office 365 enforce having the From field populated. We highly recommend you to populate this field. |
Subject Default Value: None | String | Specify the subject of email message. |
Email Type* Default Value: HTML text | Dropdown list | Select the email type. The available options are:
If the Email type is Plain text or HTML text, the Snap sends one email message per each Document. |
Template body Default Value: None | String | Specify the template of email message body. For the email type of "HTML text" and "HTML table", the Template body should be in HTML format. For "HTML table" type, the Snap expects to find <table> and </table> tags inside the Template body. One Document at the input view corresponds to one row of the HTML table. For each Document, the Snap gets a map data referenced by the Table-data path property and insert a row into the HTML table of the message body. The Table-data path property can also reference an array of map data. The Snap uses the key sets of the map data to compose the column headers of the table. The Snap processes the entire stream of Documents in a batch to generate the superset of keys. See Expression Language for items to use with the expression toggle (=), but set Email type to Plain Text. Example: The "HTML table" type of the Template body uses Cascading Style Sheets (CSS) for the table style. Gmail does not support CSS in rendering HTML table. You should use in-line style of the HTML table for proper rendering in Gmail. The Snap does not support the in-line style HTML table for individual cells in the table header and rows. |
Attachments Default Value: None Snap/sales.xls smb://mydomain;snapuser@54.159.200.139:445/snapuser/sample.csv smb://snap@54.159.200.329:445/snap/sample.csv file:////prod/ImportExport/Barrett/Export/SalesforceCaseAttachments/SnapLogic/MDSTEST/AlertHanderTestAttachment.txt
| String | Specify the URLs of files that you want to attach to your email. If the URL protocol is missing, or if a given path is relative, SnapLogic automatically modifies the URL to start with "sldb:///". The Snap supports SLDB, SFTP, FILE, and SMB file protocols. The username should be included in the URL as in the example below and the password should be entered into the Attachment password property in the email account. The filename part of the URL can contain wildcards, for example, /Alert* so that multiple files can be attached for each row of Attachments property. |
Table-data path Default Value: None | Sting/Expression | Specify the JSON path to the map data which corresponds to a row in the HTML table. If it references an array of map data, such as When using just "$" in the Table-data path, the Snap creates an HTML table, wherein the Template Body has the HTML table tags ( |
Batch size Default Value: 100
| Number | Specify the Batch size property that is used only for the "HTML table" Email type. The unit of the value is in the number of rows of the HTML table. If the number of Documents the Snap receives from the input view reaches the given Batch size, the Snap composes an email message with an HTML table and sends it to the server. Multiple emails are generated, if needed, to send out all Documents. The Snap sends the last message at the end of the pipeline execution if any number of the unsent table rows remain. |
Pass through Default Value: Deselected | Checkbox | Select this checkbox to determine if input data should be passed through or not. If selected, input data will be mapped as a value to the 'original' key in the output document. |
Retries Default Value: 3 | String | Specify the number of retries when the Snap fails to send email. Initially the Snap waits for two seconds before retry, and in every subsequent retry, the delay is doubled up to an hour. |
Snap Execution Default Value: Validate & Execute | Dropdown list | Select one of the three modes in which the Snap executes. Available options are:
|
Temporary Files
During execution, data processing on Snaplex nodes occurs principally in-memory as streaming and is unencrypted. When larger datasets are processed that exceeds the available compute memory, the Snap writes Pipeline data to local storage as unencrypted to optimize the performance. These temporary files are deleted when the Snap/Pipeline execution completes. You can configure the temporary data's location in the Global properties table of the Snaplex's node properties, which can also help avoid Pipeline errors due to the unavailability of space. For more information, see Temporary Folder in Configuration Options.
HTML Table Email Template Body
Examples
Attaching Email from a File Location
In the below example, the Email Sender Snap sends an email with multiple attachments from the FILE location. The Email Sender Snap does not support wildcards in attachments to support multiple attachments. Therefore, the following Pipeline uses the Directory Browser Snap as an upstream Snap to combine multiple file paths and sends that to the Email Sender Snap.
Configure the Binary Snap to specify the directory path and to filter the files with *.PNG as in the following image.
Configure the Group By N Snap to set the Group Size as 0 so that all the files in the directory are combined as one to give one output.
Configure the Mapper Snap to map the path field against the Target path.
Finally, the Email Sender Snap to set the Attachments URL.
When you execute this pipeline, the Snap sends the email with all the attachments to the intended recipient (s).
Attach email from an SFTP location
In the below example, the Email Sender Snap mail with an attachment from the SFTP location.
Note that in order to read the file attachment from the SFTP location, the Attachment password must be set on the Account Settings of the Snap, else will display an error.
The successful execution of the pipeline displays the below output preview:
Attaching Email from an SLDB Location
In the below pipeline, the Email Sender Snap reads and sends the mail with an attachment (Customer Information.csv) from an SLDB location.
Downloads
Related Content
Community Post:
Snap Pack History
Have feedback? Email documentation@snaplogic.com | Ask a question in the SnapLogic Community
© 2017-2024 SnapLogic, Inc.