Configure a bot to send an email to one or more recipients based on an event by using the Send an email task.

For example, if an employee sends a request for a new chair (the event), you can configure the bot to send an email to their manager requesting approval before fulfilling the request.

To send an email from a bot, add and configure the Send an email task as described in the following sections:

See also Tasks: The Essentials.

Adding and configuring the task

Add and configure the Send an email task by performing the following steps:

  1. Add the Send an email task to a bot, as described in Adding a task to a bot.

  2. Configure the Send an email task by using the settings described in the tables below.

  3. When you are done, save the task by selecting one of the following:

    • Save - Save the task

    • Save & verify data - Save the task and verify the data defined.

    • Save & notify users - Save the task and notify users.

Configure the Send an email task by using the settings described in the following tables.

Setting

Description

Default (if applicable)

Task name

Name of the task. It must be unique within your app.

Table name

Table referenced by the task. Select an existing table in the list.

Click View definition to view the structure of the selected table.

See Tables: The Essentials for more information about adding tables.

Via channel

Messaging channel used to send the email. Select a messaging channel in the list.

System Default

Use Dynamic Email

Enables users to interact directly with your app in the email rather than clicking out to view the AppSheet app in a separate window. See Sending dynamic email from a bot.

To

List of email recipients.

Click Add to add an email address or an expression using the Expression Assistant. Repeat to add additional email recipients.

See Adding email recipients for more information.

Use default content?

Toggle to indicate whether you want to use the default email content or provide customized content.

If enabled, the task uses default content. If disabled, customize the content using the additional settings displayed, as described below.

Enabled

If you disable Use default content?, customize the email content using the additional settings displayed, as described below.

Setting

Description

Default (if applicable)

Email Subject

Subject of the email.

Specify text, variables, and expressions. For example:

  • Thank you for your order!

  • Thanks <<[CustomerName]>> for your order!

  • Thanks <<[CustomerName]>> for your order on <<TODAY()>> which will arrive on <<TODAY() + 7>>

Meaningful email subject

Email Body

Body of the email.

To define the email body, do one of the following:

  • Enter the email body, including text, images, variables, and expressions.

  • Leave this setting blank and specify an Email Body Template (see below).

  • Leave this setting and Email Body Template blank to use the default content.

Note: The Email Body Template setting (if specified) takes precedence over this setting.

Data values from the added or updated row, excluding Hidden or Show type columns

[Preview] Email Footer

Content that appears at the bottom of the email. For example:

Note: This setting is available only for dynamic emails, when Use Dynamic Email is set to a view.

CC

List of email recipients to carbon copy (CC).

Click Add to add an email address or an expression using the Expression Assistant. Repeat to add additional email recipients. See Adding email recipients for more information.

BCC

List of email recipients to blind carbon copy (BCC).

Click Add to add an email address or an expression using the Expression Assistant. Repeat to add additional email recipients. See Adding email recipients for more information.

Reply To

Email address that will receive replies to the email.

Enter an email address or an expression using the Expression Assistant. See Adding email recipients for more information.

noreply@appsheet

From Display

Value displayed as source of email.

Specify text, variables, and expressions. For example:

  • "From Customer Support at Cascade Fine Fruit"

  • From <<[FirstName]>> <<[LastName]>> at Cascade Fine Fruit

  • From <<CONCATENATE([FirstName], "_", [LastName], "@CascadeFruit.com")>>

Note: The From email address is set to noreply@appsheet. You cannot override this value using AppSheet in order to comply with anti-spam policies that do not permit masquerading as different email originators. If you need to customize the From email address, consider sending an email via a web-based email provider that you invoke using a web hook.

<<_APPOWNER>>

See Built-in variables.

PreHeader

Email preheader summary text that follows the subject line when viewed in an inbox.

Specify text, variables, and expressions. For example:

  • Your Order

  • Order for <<[FirstName]>> <<[LastName]>>

  • Order for <<[FirstName]>> <<[LastName]>> on <<TODAY()>>

To suppress the PreHeader, enter a single space character.

<<_UPDATEMODE>> to application '<<_APPNAME>>' table '<<_TABLENAME>>' by '<<_USEREMAIL>>' at <<_NOW>>

See Built-in variables.

For example:
Update to application 'Workflow' by 'Julie Morgan' at 8/26/2021 6:12:28 PM

Note: <<USEREMAIL>> is omitted if your app does not require authentication.

Email Body Template

Template to use for more precise control of the email body. See Using templates in a bot and the Email Body description (above).

Attachment Content Type

Content type of the email attachment file.

Valid content type values include:

  • CSV

  • HTML

  • ICS_Calendar

  • JSON

  • PDF

  • XLSX (Microsoft Excel)

  • XML

PDF is the most often used content type for email attachments.

PDF

Attachment Template

Template to use for more precise control of the email attachment. See Using templates in a bot and Archiving email attachments for more information.

Attachment Name

Name of attachment.

Specify text, variables, and expressions. For example:

  • My Attachment

  • My Attachment for <<CustomerName>>

  • My Attachment for <<CustomerName>> from <<_APPNAME>> on <<TODAY()>>

See Archiving email attachments and How the archive attachment file name if formed for more information.

One of the following values:

  • None (if Attachment Archive is set to AttachAndDoNotArchive)

  • ChangeReport

Attachment Archive

Attachment file archive configuration.

Valid values include:

  • AttachAndDoNotArchive - Attach file to email without archiving it.

  • AttachAndArchive - Attach file to email and archive it.

  • ArchiveAndDoNotAttach - Archive the file but do not attach it to the email. This option is useful if the attachment file is too large to include as an attachment. Instead, the email body can include the URL or Weblink to the archived attachment file.

See Archiving email attachments for more information.

Not Specified

Attachment File Store

File system where attachments are stored.

When set to Default (the default setting), the attachment file is archived to the authentication provider file system. For example, if your authentication provider is Google, the attachment file is archived to Google Drive. If your authentication provider is Dropbox, the attachment file is archived to Dropbox.

Notes:

  • If Smartsheet is your authentication provider, AppSheet archives the attachment file to Google Drive as Smartsheet does not have a file system. If you use Smartsheet and wish to archive attachment files, you must include Google as a data source, as described in Using multiple data sources.

  • Business pricing plan customers can archive attachment files to a Cloud Object Store.

See Archiving email attachments for more information.

Default

Attachment Folder Path

Folder path where attachments are saved relative to the default app folder.

Specify text and expressions. For example:

  • MyAttachments/MyPurchaseOrders

  • <<CONCATENATE("MyAttachments/PurchaseOrdersByMonth_", YEAR(NOW()), "_", MONTH(NOW()))>>:

In the second example, email attachment files would be stored in a separate folder, based on the month. For example: MyAttachments/PurchaseOrdersByMonth_2019_02

See Archiving email attachments and How the archive attachment folder name if formed for more information.

Attachments

Disable Timestamp?

Toggle to indicate whether to append a timestamp to attachment filenames. Appending the timestamp will ensure the filenames are unique.

The timestamp contains the date and time at which the attachment file was created, formatted as follows: yyyyMMdd_HHmmss_fff indicating year, month, day, hours, minutes, seconds, and milliseconds. For example:

MyAttachmentName20190207_133355_804.pdf

If you disable the timestamp, you must ensure that every attachment filename is unique. Otherwise, the attachment files may be overwritten. For example, if you are archiving your attachment files to Google Drive and you disable the timestamp, only the most recent attachment file will be available. Older attachment files with the same name will have been overwritten.

See Archiving email attachments for more information.

Disabled (timestamp is appended)

Attachment Page Orientation

Page orientation of the attachment. Valid values include: Portrait and Landscape

Note: This setting is available only if you set Attachment Content Type to PDF.

Not Specified

Attachment Page Size

Page size. Select a standard size or select Custom and enter the Attachment Page Width and Attachment Page Height in millimeters.

Note: This setting is available only if you set Attachment Content Type to PDF.

Not Specified

Use Custom Margins

Toggle to indicate whether you want to specify custom margins for the attachment.

If disabled, the task uses default margins. If enabled, customize the margins using the additional settings displayed, as described below.

Note: This setting is available only if you set Attachment Content Type to PDF.

Disabled

Other Attachments

Other attachment files such as drawings, images, signatures, thumbnails, or files.

Click Add to add other attachments to the email. Specify text or expressions. Repeat to add additional attachment files.

See Adding other attachments to an email for more information.

If you enable Use Custom Margins, customize the attachment page margins using the additional settings displayed, as described below.

Setting

Description

Default (if applicable)

Attachment Page Margin Top

Top margin for the attachment in points.

0

Attachment Page Margin Right

Right margin for the attachment in points.

0

Attachment Page Margin Bottom

Bottom margin for the attachment in points.

0

Attachment Page Margin Left

Left margin for the attachment in points.

0

Adding email recipients

The following provides guidelines for adding the email recipients in To, CC, and BCC when configuring the email (described above):

  • Enter a specific email address, such as JohnHughes@gmail.com.
    If an email address contains special characters such as hyphen or plus, you must enclose the email address in quotes. For example: "John-L-Hughes@gmail.com"

  • Use a field in a record that is being modified.
    For example, when a new order is received, you can send an email to the customer who created the order. In this scenario, enter the name of the field that contains the customer's email address. For example, if the CustomerEmail field in the order record contains the customer's email address, enter the following expression: [CustomerEmail]

  • Use a field in a record that is referenced by the record being modified.
    For example, when a new order is received, you can send an email to the customer who created the order. Each order record might contain a reference to a customer record that contains the customer's email address. In this scenario, enter the name of the order record field that references the customer record followed by the name of the customer record field that contains the customer's email address. For example, if the order record field that references the customer record is CustRef and the name of the customer record field containing the customer's email address is CustEmail, specify the customer's email address by entering the expression: [CustRef].[CustEmail]

  • Use an entire column in another table.
    For example, each time a new order is added, you can send an email to all of the people defined in another table. In this scenario, enter the name of the table followed by the field that contains the email address. For example, if you create a table called PeopleToInform that contains two columns, Name and EmailAddress, each time a new order is added, you can send email to all of the people in the PeopleToInform table by entering the expression: PeopleToInform[EmailAddress]

  • Use selected rows in another table.
    For example, each time a new order is added, you can send an email to all of the people in the sales department. In this scenario, enter the name of the table followed by the field that contains the email address, and set the department field to Sales. For example, if you create a table called PeopleToInform that contains three columns, Name, EmailAddress, and Department, each time a new order is added, you can send an email to all of the people in the PeopleToInform table who are in the Sales department by entering the expression: SELECT(PeopleToInform[EmailAddress], ([Department] = "Sales"), TRUE)

Note: While the app is in test mode (that is, you have not run a deployment check and deployed the app), any messages sent will be sent to the app creator only. To confirm the list of email recipients that will be included in To, CC, and BCC, check the Audit History, as described in How do I determine whether an email was delivered?

Did this answer your question?