Skip to end of banner
Go to start of banner

Email Sender

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 68 Current »

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

  • Min: 0

  • Max: 1

Email Reader

Each document may contain Map data with values for JavaScript expression in the properties and/or data for the HTML table rows.

  • If the main portion of the Pipeline fails, the Email Sender Snap in this case may succeed and send a message with incorrect data.

  • If an input view is configured and the Snap is connected to incoming documents, emails will be sent for each document processed unless you are using HTML Table as the Email Type. If you want to just send an attachment to an email, do not add an input view. Instead, just place the Snap unconnected on the workspace.

Output

Document

  • Min: 1

  • Max: 1

Mapper

Each document contains a Map data which represents one successfully-sent email message. The following is an example of an output document:

[{"to":"user@example.com","body":"","emailType":"text/html","subject":"Tweeters","from":"user@example.com","attachments":[{"url":"sldb:///result-20140128115802.json","filename":"result-20140128115802.json"}],"cc":null}]

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:

  • Stop Pipeline Execution: Stops the current pipeline execution when the Snap encounters an error.

  • Discard Error Data and Continue: Ignores the error, discards that record, and continues with the rest of the records.

  • Route Error Data to Error View: Routes the error data to an error view without stopping the Snap execution.

Learn more about Error handling in Pipelines.

Snap Settings

  • Asterisk (*): Indicates a mandatory field.

  • Suggestion icon ((blue star)): Indicates a list that is dynamically populated based on the configuration.

  • Expression icon ((blue star)): Indicates whether the value is an expression (if enabled) or a static value (if disabled). Learn more about Using Expressions in SnapLogic.

  • Add icon ((blue star)): Indicates that you can add fields in the fieldset.

  • Remove icon ((blue star)): Indicates that you can remove fields from the fieldset.

Field Name

Field Type

Description

Label*

Default ValueEmail Sender
ExampleEmail_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
Example: Snap@example.com, youto@example.com

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.

_customer + " Defects and Stories" where the pipeline has a pipeline parameter of customer

Most mail systems use a comma as an address separator. If the Email Sender Snap is having issues with multiple users in the list, verify that you are using the correct address separator for your mail system. Use the correct address separator for the To, CC, Bcc, and From fields.

CC

Default Value: None
Example: meto@example.com, someoneelse@example.com

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
Example: meto@example.com, someoneelse@example.com

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
Example: meto@example.com, someoneelse@example.com

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 
Example: Using Email Sender Snap

String

Specify the subject of email message.

Email Type*

Default Value: HTML text
Example: HTML table 

Dropdown list

Select the email type. The available options are:

  • Plain text

  • HTML text

  • HTML table

If the Email type is Plain text or HTML text, the Snap sends one email message per each Document. 
If the Email type is HTML table, each Document provides one row of information for the HTML table.

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.
Learn more, HTML Table Email Template Body.

Attachments

Default Value: None
Example: sftp://qatest@sftp.example.com/home/qatest/update_*.xls

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.

Using FILE Protocol for Files

  • The Email Sender Snap does not support wildcards in attachments.
    For example, file:////prod/ImportExport/Barrett/Export/SalesforceCaseAttachments/SnapLogic/MDSTEST/Alert*.

  • To attach multiple files, add them as a separate row for each file. Otherwise, you can use the Directory Browser Snap as an upstream Snap and combine all the paths it outputs to a list. See the example below.

Using Files in SFTP and SMB

  • The Email Sender Snap first downloads SFTP or SMB files to a temporary location in the local disk before sending them as attachments. Therefore, you must ensure that there is sufficient free local disk space in the Snaplex. All temporary files are deleted once the Snap completes execution.

  • The character '@' is a reserved character and is used as a delimiter between the username and hostname in the URL. Do not use it as part of filenames or directory names.

Using files in SLDB

  • Attaching files from the same project: <file_name> or sldb:///<file_name>. For example, asset.json or sldb:///asset.json.

  • Attaching files from a shared project: shared/<file_name> or sldb:///shared/<file_name>. For example, shared/asset.json or sldb:///shared/asset.json.

  • Attaching files from a shared project, wherein the pipeline being developed is also a shared project: <file_name> or sldb:///<file_name>. For example, asset.json or sldb:///asset.json.

Table-data path

Default Value: None
Example: $.table

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 $.Customers[::1], the Snap will add each map data into the HTML table. If the object referenced by this property is not a map data nor an array of map data, the input document will be routed to the error view.

When using just "$" in the Table-data path, the Snap creates an HTML table, wherein the Template Body has the HTML table tags (<table></table>). Thus, the table auto-fills with the incoming data.

When the Table-data path is an HTML table, the Snap auto-fills the incoming data. The Snap does not send any email if there is no input data sent to the Snap. 

The document structure needs to be flat. You can do this by using a Structure Snap before the Email Sender Snap, creating a new map of all the required fields, and then using "$" as table-data path.

Batch size

Default Value: 100
Example: 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 
Example: Selected 

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
Example: 0 (no retry) 

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 ValueValidate & Execute
Example: Execute only

Dropdown list

Select one of the three modes in which the Snap executes. Available options are:

  • Validate & Execute: Performs limited execution of the Snap, and generates a data preview during Pipeline validation. Subsequently, performs full execution of the Snap (unlimited records) during Pipeline runtime.

  • Execute only: Performs full execution of the Snap during Pipeline execution without generating preview data.

  • Disabled: Disables the Snap and all Snaps that are downstream from it.

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

This note applies to the case your account is a Gmail account, but it may also apply to other web-based email accounts. Gmail SMTP accounts may not work with the Email Sender Snap. Gmail processes an email hijack detection based on IP addresses and locations. If it sees the IP address that the IMAP/POP3 client app is running from is different than the usual locations, it suspects the account is being hijacked and sends error messages like:

  • +OK Gpop ready for requests from 23.23.38.68 n18mb191678450qav" or

  • "Cannot connect to the endpoint reason: [SYS/PERM] Your account is not enabled for POP access. Please visit your Gmail settings page and enable your account for POP access." or other variations.

You may find an email from Gmail in the inbox titled "Suspicious sign in prevented", which is caused by the execution of Email Reader Snap. You may be able to see more messages from Gmail in your Gmail account web page: Account > Security > Recent Activity > View activity.

There are no settings available in the Gmail account to disable this security feature. Contact Gmail Support if your Gmail account must work in Email Reader Snap.

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.

directory-browser.png

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).

Download this Pipeline

Attaching Email from an SFTP Location

In the below example, the Email Sender Snap mail with an attachment from the SFTP location.

Sender (2).png

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.

email-sender_account.png

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.

Sender1.png

Downloads

  File Modified
You are not logged in. Any changes you make will be marked as anonymous. You may want to Log In if you already have an account.
No files shared here yet.
  • Drag and drop to upload or browse for files
  • Related Content

    Snap Pack History

     Click here to expand...

    Release

    Snap Pack Version

    Date

    Type

    Updates

    May 2024

    main26341

    Stable

    Updated and certified against the current SnapLogic Platform release.

    February 2024

    main25112

    Stable

    Updated and certified against the current SnapLogic Platform release.

    November 2023

    main23721

    Stable

    Updated and certified against the current SnapLogic Platform release.

    August 2023

    main22460

    Stable

    Updated and certified against the current SnapLogic Platform release.

    May 2023

    main 21015

    Stable

    Upgraded with the latest SnapLogic Platform release.

    February 2023

    432patches20237

    Latest

    The JSCH library has been upgraded to version 0.2.7.

    February 2023

    main19844

    Stable

    Upgraded with the latest SnapLogic Platform release.

    November 2022

    main18944

     

    Stable

    Upgraded with the latest SnapLogic Platform release.

    August 2022

    430patches17403

    Latest

    The Email Account now does not display a null pointer exception when the Mail Properties fieldset is left blank as this is not a mandatory field. Earlier, the account displayed a null pointer exception for null values in this fieldset.

    August 2022

    main17386

    Stable

    The Email Sender Snap supports the file:/// protocol in the Attachments field.

    4.29

    main15993

     

    Stable

    Upgraded with the latest SnapLogic Platform release.

    4.28 Patch

    428patches14812

    24 Mar 2022 

    Latest

    Fixed an issue with the Email Sender Snap where SMB files were attached to an e-mail causing the Snaps to fail with a NullPointer Exception.

    4.28

    main14627

    12 Feb 2022 

    Stable

    Upgraded with the latest SnapLogic Platform release.

    4.27

    main12833

    13 Nov 2021 

    Stable

    Upgraded with the latest SnapLogic Platform release.

    4.26 Patch

    426patches11591

    21 Sep 2021 

    Latest

    Fixed the following issues with the Email Archive Snap where the Snap:

    • Failed with an error User is authenticated but not connected, as the Snap did not re-authenticate with the server after the connection expired due to the long durations in the execution of Ultra Pipelines.

    • Caused multiple copies of the same source message in the target folder when the Snap was executed multiple times in preview.

    4.26

    main11181

    14 Aug 2021 

    Stable

    Upgraded with the latest SnapLogic Platform release.

    4.25

    main9554

    08 May 2021 

    Stable

    Upgraded with the latest SnapLogic Platform release.

    4.24

    main8556

    13 Feb 2021

    Stable

    Upgraded with the latest SnapLogic Platform release.

    4.23

    main7430

    14 Nov 2020 

    Stable

    Upgraded with the latest SnapLogic Platform release.

    4.22

    422patches6730

    17 Sep 2020 

    Latest

    Fixes the connectivity issue for the Email Sender Snap by making it compatible with TLS version 1.2.

    4.22

    main6403

    12 Sep 2020 

    Stable

    Upgraded with the latest SnapLogic Platform release.

    4.21

    snapsmrc542

    -

    Stable

    Upgraded with the latest SnapLogic Platform release.

    4.20 Patch

    email8813

    -

    Latest

    Fixes an issue with the Email Sender Snap that caused the Snap to fail while uploading attachments to SMB locations when the attachment password contained a forward slash "/".

    4.20

    snapsmrc535

    -

    Stable

    Upgraded with the latest SnapLogic Platform release.

    4.19

    snaprsmrc528

    -

    Stable

    Upgraded with the latest SnapLogic Platform release.

    4.18

    snapsmrc523

    -

    Stable

    Upgraded with the latest SnapLogic Platform release.

    4.17 Patch

    ALL7402

    -

    Latest

    Pushed automatic rebuild of the latest version of each Snap Pack to SnapLogic UAT and Elastic servers.

    4.17

    snapsmrc515

    -

    Stable

    Added the Snap Execution field to all Standard-mode Snaps. In some Snaps, this field replaces the existing Execute during preview check box.

    4.16 Patch

    email6772

    -

    Latest

    Fixed an issue with the Email Delete Snap wherein the Snap fails to delete emails with multiple input documents.

    4.16

    snapsmrc508

    -

    Stable

    Upgraded with the latest SnapLogic Platform release.

    4.15 Patch

    email6267

    -

    Latest

    Fixed an issue with handling null attachments in the Email Sender and Email Reader Snaps.

    4.15

    snapsmrc500

    -

    Stable

    Upgraded with the latest SnapLogic Platform release.

    4.14 Patch

    email5740

    -

    Latest

    Fixed an issue with POP3 access in Email Reader, Archive, and Delete Snaps. IMAP specific methods are now not called during POP3 access.

    4.14 Patch

    email5662

    -

    Latest

    Fixed the Email Reader/Sender Snaps that replace the "+" symbol in attachment files with a space in the output.

    4.14

    snapsmrc490

    -

    Stable

    Upgraded with the latest SnapLogic Platform release.

    4.13 Patch

    email5368

    -

    Latest

    • Enhanced Email Reader Snap to perform read and archive functions. 

    • Fixed the Email Archive Snap that does not display sorting errors. 

    • Fixed the Email Reader Snap that slows down when renaming the downloaded attachments.

    4.13

    snapsmrc486

    -

    Stable

    Upgraded with the latest SnapLogic Platform release.

    4.12 Patch

    email4948

    -

    Latest

    Fixed an issue with the Email Reader Snap, wherein the Snap gets corrupted when a file name and content contains Unicode characters.

    4.12

    snapsmrc480

    -

    Stable

    Upgraded with the latest SnapLogic Platform release.

    4.11 Patch

    email4481

    -

    Latest

    • Resolved an issue with Email Reader Snap:

      • The Snap now reads to fetch mails from a shared mail box.

      • The Snap can now read the file attachment that has a percent sign [%], or ó.  

    • Updated the Email Delete Snap code to display the default value as zero instead of blank in the UI.

    4.11

    snapsmrc465

    -

    Stable

    Upgraded with the latest SnapLogic Platform release.

    4.10 Patch

    email4025

    -

    Latest

    Added Connection, Read, and Write timeout settings that support retries for SMTP, POP3, and IMAP email account types.

    4.10 Patch

    email3944

    -

    Latest

    Resolved an issue with the Email Reader Snap to support the shared mailbox on an Office 365 server. Email Reader did not support Office 365 shared mailbox until we explicitly disabled plaintext authentication when we specify ssl authentication. The Office server falsely reports that it supports PLAIN authentication and the snap library is happy to try it but it always fails. This is a known issue with Office 365 / Outlook.

    4.10

    snapsmrc414

    -

    Stable

    • Email Account Updated with Attachment password property (encrypted) to support the attachment function for the Email Sender and Reader Snaps.

    • Email Reader Snap updated with the Attachment folder property to store the attached files on a path.

    • Email Sender Snap extended support to SLDB, SFTP, and SMB file protocols for the attachments

    4.9.10

    snapsmrc405

    -

    Latest

    Upgraded with the latest SnapLogic Platform release.

    4.8.0 Patch

    email2816

    -

    Latest

    Addressed an issue with Email Sender Snap being unable to Handle Chinese characters.

    4.8

    -

    -

    Stable

    Upgraded with the latest SnapLogic Platform release.

    4.7.0 Patch

    email2499

    -

    Latest

    Added logic to process emails that have text files as attachments and download the files to the provided attachment location.

    4.6.0

    snapsmrc362

    -

    Latest

    • Resolved an issue in Email Sender Snap that failed when attached a file that had spaces in the file name.

    • Enhanced error handling in Email Reader Snap to appropriately route connection errors to error view.

    4.5.1

    email1564

    -

    Latest

    • BCC field added to the Email Sender Snap.

    • Retries added to the Email Sender Snap.

    -

    -

    August 7, 2015 (2015.25/4.2.1)

    -

    • Email Reader Snap now has an option to read older message first.

    • Resolved Null Pointer exception in Email Reader Snap when reading from Yahoo mailbox.

    -

    -

    June 27, 2015 (2015.22)

    -

    Email Sender now supports the ability to pass through input documents.

    -

    -

    June 6, 2015 (2015.20)

    -

    Email Reader: Resolved an error with concatenating file names in attachments

    -

    -

    Snap Updates, December 20, 2014

    -

    NEW! Email Archive introduced in this release.

    -

    -

    November 2014 Launch Updates

    -

    NEW! Email Delete Snap was introduced in this release.

    -

    -

    October 18, 2014

    -

    Email Sender now allows JSONPath expressions

    -

    -

    Fall 2014 Launch Updates

    -

    Email Sender: better handling of error messages to the error view.

    -

    -

    December 2013 Launch Updates

    -

    Email Reader Snap and Email Sender Snap were updated to handle attachments.

    -

    -

    September 2013 Updates

    -

    Email Sender & Email Reader introduced in this release. This pair of Snaps let you send and receive an email when you run a pipeline.

    Updated and certified against the current SnapLogic Platform release.


    • No labels