Skip to main content
Automation API

send_email

Use this action to send an email from an automation.

Tip

Read the live config shape of each action type from GET /v1/automation/meta/action before you build on it.

In the automation editor, this action is Send an email in the Email & documents family. Its group is action, and it works with every trigger.

Send it in the actions array of Create an automation or Update an automation. An update replaces the whole array, so include the other actions.

Example​

This action tells juliet@acme.com about a new lead and puts the record ID in the subject:

{
"type": "send_email",
"config": {
"to_address": ["juliet@acme.com"],
"subject": ["New record: ", { "kind": "variable", "source": "meta", "meta_type": "app_record_id", "app_id": 87 }],
"message_body": ["<p>A new lead came in.</p>"],
"smtp_account_id": 812
}
}

Config​

PropertyTypeDescriptionExample value
to_addresstemplate valueRequired. Recipient address or addresses.["juliet@acme.com"]
subjecttemplate valueRequired. Subject line.["New lead"]
reply_addresstemplate valueReply-to address. Empty when left out.["sales@acme.com"]
cc_addresstemplate valueCC address or addresses. Empty when left out.["romeo@acme.com"]
bcc_addresstemplate valueBCC address or addresses. Empty when left out.["archive@acme.com"]
from_addresstemplate valueSender address. Empty when left out.["sales@acme.com"]
from_nametemplate valueSender display name. Empty when left out.["Acme Sales"]
message_bodytemplate valueHTML body. Empty when left out.["<p>Hello</p>"]
smtp_account_idintegerID of the SMTP account to send from. Left out, Tape uses the organization's default SMTP account. See Sender address. Same ID as smtp_settings_id of the email endpoint.812
attach_files_variable_defsarray of referencesFile variables Tape can attach: attachment or image fields, file custom variables such as the PDF from create_pdf, or the files of the trigger. Empty when left out.[]
attach_files_match_typeenumWhich of those files Tape attaches. Default all. See Attachment modes."all"
attach_files_match_conditionfilter group | nullLimits the attached files in the filtered and most_recent_filtered modes. An empty AND group when left out.null

To find smtp_account_id, select the account in this action in the automation editor, then retrieve the automation. The API has no endpoint that lists SMTP accounts. Without the automation API, see Sender address for a way through the editor.

Attachment modes​

attach_files_match_type takes one of these lower-case tokens:

  • all: attaches every candidate file. Ignores the condition.
  • most_recent: attaches the most recent file. Ignores the condition.
  • filtered: attaches the files that match attach_files_match_condition.
  • most_recent_filtered: attaches the most recent file that matches attach_files_match_condition.

General behavior​

  • to_address and subject are the only required keys. Every other address, name and body defaults to empty.
  • Without message_body, Tape sends the email with an empty body.
  • Every email an automation sends counts against the organization's shared 24-hour send quota.

Requirements​

  • To add or change this action through the API, your token needs the automations:edit capability. See Capabilities.
  • You must administer the workspace that the automation's database app belongs to.

Next steps​