Email attachment

Email attachment

The Email attachment function sends email notifications and attachments using an external SMTP server. To configure the function, valid credentials are required. 

To configure the Email attachment function, take the following steps:

In SMTP Settings, enter the following details of the SMTP server you want to use. Optionally, credentials from the Secrets wallet can be used:

Settings

Description

Settings

Description

Host name

URL of the SMTP server

Port

Port number of the SMTP. You can use either of the following options:

  • 25: Port number for a non-TLS connection

  • 465: Port number for a TLS connection

Username

Username of the SMTP server account

Password

Password of the SMTP server account

TLS only

By default, this check box is selected. In this case, the connection will enforce the use of TLS when connecting to the server.

If you clear this check box, the TLS is used only if the server supports the STARTTLS extension.

Note!

In most cases, it is recommended to select this check box, if you are connecting to port 465. Clear this check box if you are connecting to port 587 or 25.

The New message section is used to configure the sender message information. The following fields are available: 

Setting

Description

Setting

Description

From

Email address of the sender. For example, Username <sender@address.com>.

Recipient(s)

Email address of the recipient. Multiple addresses can be added, use either the enter or comma (,) keys to input another recipient.

Subject

Subject of the email.

Message

The text is to be included in the email.

Note!

The Email attachment function supports Variable insertion in all the fields of New message:

  • From

  • Recipient(s)

  • Subject

  • Message

Only the first payload can be interpolated in the fields mentioned above.

If you select Attach records as file(s), you can access the Filename options section to attach the records as file(s).

Note!

Usage Engine Cloud Edition follows this behavior:

  • If the attach record as file(s) is not selected, an email will be sent with no payload attached.

  • If the attach record as file(s) is selected, an email with the designated payload will be sent. 

In Filename information, enter the following details of the file(s) that you want to attach with the email.

File output settings

Description

File output settings

Description

Collector filename

Select Collector filename if you want to keep the same filename as your input file(s).

If the collector does not have a filename, the function generates a name based on the function, for example, Counter.

If you use the Script function and send the data out in the Flush that is called at the end of each transaction, the original filename is lost, and a new filename is generated based on the name of the Script function.

If you use the Aggregate function, it will merge all the payloads and generate a new filename based on the name of the Aggregate function.

The function appends the file format extension to the filename based on the file format selected below, if the selected extension is not in the filename.

Custom filename

Select Custom filename to define a new filename for all the output files.

The function appends the file format extension to the filename based on the file format selected below, so you do not need to add any extensions to the filename.

Note!

  • Multiple attachments can be sent in an email instead of a single attachment.

  • To include multiple attachments in an email, enter a variable in the Custom filename field. For example, ${payload.fieldName}. Using a variable that matches a field in the record, you can generate multiple files with unique names. For more details, see Variable insertion.

Note!

For existing streams, if you would like to use the new filename saving method as described above, you can check the New filename saving method check box.

In File format, select the format of the output file(s) from the following options:

File format

Description

File format

Description

CSV

Select to generate the output file in CSV format. Select Include table header to include the table header in the output file(s).

Specify a Delimiter for the CSV file format. The default value is ','.

Excel

Select to generate the output file in Excel format. You can also specify the Sheet name. The default sheet name is Sheet 1.

There is an option to toggle on the Include table header in the emails.