send_email
Use this action to send an email from an automation.
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
| Property | Type | Description | Example value |
|---|---|---|---|
to_address | template value | Required. Recipient address or addresses. | ["juliet@acme.com"] |
subject | template value | Required. Subject line. | ["New lead"] |
reply_address | template value | Reply-to address. Empty when left out. | ["sales@acme.com"] |
cc_address | template value | CC address or addresses. Empty when left out. | ["romeo@acme.com"] |
bcc_address | template value | BCC address or addresses. Empty when left out. | ["archive@acme.com"] |
from_address | template value | Sender address. Empty when left out. | ["sales@acme.com"] |
from_name | template value | Sender display name. Empty when left out. | ["Acme Sales"] |
message_body | template value | HTML body. Empty when left out. | ["<p>Hello</p>"] |
smtp_account_id | integer | ID 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_defs | array of references | File 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_type | enum | Which of those files Tape attaches. Default all. See Attachment modes. | "all" |
attach_files_match_condition | filter group | null | Limits 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 matchattach_files_match_condition.most_recent_filtered: attaches the most recent file that matchesattach_files_match_condition.
General behavior
to_addressandsubjectare 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:editcapability. See Capabilities. - You must administer the workspace that the automation's database app belongs to.