You can learn more about sending email, using templates, and using expressions with workflow in the Workflow: Sending Email section.

Configuring Email

You can customize the email you send. Customization makes extensive use of variables. You can customize the following aspects of the email.

Send to: This is a list of email addresses or expressions that yield email addresses. Each value must be entered on a separate line.

  1. You can enter specific email addresses, such as [email protected]. If you enter an email address that contains special characters such as hyphen or plus, you must enclose the email address in quotes, such as:
    "[email protected]".
  2. You can specify that the email address be taken from a field in the record that is being updated. For example, when a new order is added, you may wish to send email to the customer who created the order. You can do this by entering an expression specifying the field name containing the customer's email address. For example, if there is a field called "CustomerEmail" in the added order record, you can specify:
     [CustomerEmail]
  3. You can specify that the email address be taken from a field in a record that is referenced by the record being added or updated. For example, each of your Order records might contain a reference to a Customer record. Each Customer record might contain the customer's email address. When a new order is added, you can send email to the customer who created the order. You can do this by entering the name of the Order record field that references the customer record, followed by the name of the Customer record field containing the customer's email address. For example, assume the name of the Order record field that references the customer record is CustRef. Assume the name of the Customer record field containing the customer's email address is CustEmail. You can specify the customer's email address by entering the expression:
     [CustRef].[CustEmail]
  4. You can specify that the email addresses be taken from an entire column in another table. For example, you could create a table called PeopleToInform having 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. Do this by entering the expression:
     PeopleToInform[EmailAddress]
  5. You can specify that the email addresses be taken from selected rows in another table. For example, you could create a table called PeopleToInform having three columns, Name, EmailAddress, and Department. Each time a new order is added, you can send email to all of the people in the PeopleToInform table who are in the "Sales" Department. Do this by entering the expression:
    SELECT(PeopleToInform[EmailAddress], ([Department] = "Sales"), TRUE)

While the app is in test mode (i.e. it has not passed a Deployment Check), any messages sent from workflow actions will only be sent to the app creator.

You can see the "Send to", "CC", and "BCC" values who would have received the email by checking the Audit History. It will contain a warning like the following:

"Warnings": "Warning: The client device is running app version 1.000287, which is the latest version. That version is not deployed so all workflow emails are being sent to the app creator. This email would have gone To '[email protected]' CC'ed to '[email protected]' and BCC'ed to '[email protected]'",

Email Subject:
Emails always include a Subject.

If you do not specify a Subject, AppSheet creates a default Subject.

You can specify a constant Subject.

Thanks for Your Order!

You can include variables in the Subject that are replaced by values from the record. 

Thanks <<[CustomerName]>> for Your Order! 

You can include expressions in the Subject.

Thanks <<[CustomerName]>> for Your Order on <<TODAY()>> which Will Arrive on <<TODAY() + 7>>

Email body: You have three options when it comes to the body of the email. 

  1. You can do nothing and receive a Default Email Body.
  2. You can customize the Email Body field.
  3. You can specify an Email Body template.

Default Email Body
If you do nothing, the default email body will contains all of the data values from the updated row except for Hidden columns and Show type columns.

Email Body
You can specify a Body containing text, images, variables, and expressions directly in the Body attribute. After the variables and expressions are replaced, the result becomes the email body. 

Specifying the Body in this way works if you have a very simple email Body; otherwise, you should use an Email Body Template.

Email Body Template
You can precisely control the contents and format of the Body using a template file as described here.

Attachment File

You can create and include an attachment file with your email. The attachment file can take many forms including:

  1. PDF
  2. CSV
  3. HTML
  4. JSON
  5. XLSX (Microsoft Excel)
  6. XML
  7. Text

PDF attachments are the most popular form of attachment file. Other forms of attachment files are useful but less common.

You control the type, content, and format of the attachment file using an email Attachment Template as described here.


Attachment Name: Every email attachment has an Attachment Name. 

If you do not specify an Attachment Name, the following default value is used. 

ChangeReport

You can specify a constant Attachment Name.

My Attachment Name

You can include variables in the Attachment Name that are replaced by values from the record.

My Attachment for <<CustomerName>>

You can include expressions in the Attachment Name.

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


Attachment Archive: You can archive the PDF attachment as described here

Attachment Page Orientation: You can specify either "Portrait" or "Landscape". 

Attachment Page Size: You can specify the page size. 

Other Attachments: You can attach a wide variety of files to your email as described here.

CC: Email "CC" value. This is a list of email addresses or expressions that yield email addresses as described with Send to. Each value must be entered on a separate line.

BCC: Email "BCC" value. This is a list of email addresses or expressions that yield email addresses as described with Send to. Each value must be entered on a separate line. 

Reply to: Email "Reply to" email address. You may specify:

  • Nothing, in which case the reply to email address is "[email protected]" .
  • A specific email addresses, such as [email protected]. If you enter an email address that contains special characters such as hyphen or plus, you must enclose the email address in quotes, such as "[email protected]".
  • An expression that yields a single email address.

From Display: This value is displayed as the source of the email. You can specify:

Nothing, in which case the application owner name is used.

A constant value which is enclosed in quote characters.

"From Customer Support at Cascade Fine Fruit" 

A template that refer to table columns. 

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

A template that contains expressions.

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


From:
Workflow email is always sent from the following AppSheet email account  

[email protected]

You cannot override this value because the anti-spam policies of email providers do not permit us to send mail and masquerade as different email originators.

If you must customize the From email address, consider sending email via a web based email provider that you invoke via a workflow web hook.

PreHeader: Every email can include a PreHeader. 

If you specify nothing, the following default PreHeader is used.

<<_UPDATEMODE>> to application '<<_APPNAME>>' table '<<_TABLENAME>>' by '<<USEREMAIL()>>' at <<_NOW>> 

This yields a PreHeader such as "Update to application 'Workflow' by 'Julie Morgan' at 8/26/2015 6:12:28 PM". 

If your application does not require user authentication, the value " by <<USEREMAIL()>>" is omitted from the PreHeader.

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

You can specify a constant PreHeader.

Your Order

You can specify a PreHeader containing references from fields in the table.

Order for <<[FirstName]>> <<[Lastname]>>

You can specify a PreHeader containing expressions.

Order for <<[FirstName]>> <<[Lastname]>> on <<TODAY()>>

You can suppress the PreHeader by entering a single empty character.

(A single empty space, and nothing else.)

 

Determining Whether Email Was Delivered

You can check Audit History to see if the email was delivered. The "EmailTaskResult" property contains:

  1. Status: The status returned by Mandrill.
  2. Error-Message; The error message, if any, returned by Mandrill.
  3. Tracking-Id: The email tracking id returned by Mandrill.

It may take a few minutes before the "EmailTaskResult" appears in Audit History. Mandrill only returns this information after it attempts to deliver the email.
 

Troubleshooting Email

 See this article.

 

Did this answer your question?