Skip to main content

collected_records_send_email

Internal beta โ€” config shape is being migrated

The Automation API is an internal beta and is not released yet โ€” endpoints and payloads may change or be withdrawn without notice. This action's config is being migrated to a typed schema; the fields below reflect that in-progress shape. Always read the authoritative, live shape from GET /v1/automation/meta/action before building against it.

Send email for collected records โ€” sends one email per record in a collection produced by an earlier action. group: "action". No specific trigger context is required.

Part of the Email & documents family. This page documents the typed config; for how an action sits inside an automation definition, see Actions and Action examples.

Configโ€‹

KeyTypeRequiredDescription
to_addresstemplate valueyesRecipient address(es).
subjecttemplate valueyesEmail subject.
record_collectionreferencenoThe record collection to send one email for each of โ€” a prior action's record_collection output. Omitted โ†’ the enclosing for-loop's collection.
reply_addresstemplate valuenoReply-to address. Empty when omitted.
cc_addresstemplate valuenoCC address(es). Empty when omitted.
bcc_addresstemplate valuenoBCC address(es). Empty when omitted.
from_addresstemplate valuenoSender address. Empty when omitted.
from_nametemplate valuenoSender display name. Empty when omitted.
message_bodytemplate valuenoHTML email body. Empty when omitted.
smtp_account_idintegernoId of the SMTP account to send from. Omitted โ†’ the organization's default SMTP account.
attach_files_variable_defsarray of referencesnoFile variables whose files are candidates for attachment. Empty when omitted.
attach_files_match_typeenumnoWhich candidate files are attached. Default all.
attach_files_match_conditionfilter group | nullnoRestricts attached files for the filtered / most_recent_filtered modes. Empty condition ("match all") when omitted or null.
fields_expandedbooleannoEditor-only UI flag: whether the address fields are expanded in the editor. Omitted from the live discovery schema (like create_pdf's *_expanded flags); carried through on read when present.

attach_files_match_type tokens (lower-case): all, filtered, most_recent, most_recent_filtered. all and most_recent ignore the condition; filtered and most_recent_filtered restrict to files matching attach_files_match_condition.

Exampleโ€‹

An action entry inside an automation definition's actions[]:

{
"type": "collected_records_send_email",
"config": {
"record_collection": { "kind": "variable", "source": "action", "action_type": "record_collection", "app_id": 812 },
"to_address": ["[email protected]"],
"subject": ["Record update: ", { "kind": "variable", "source": "meta", "meta_type": "app_record_id" }],
"message_body": ["<p>One of the collected records changed.</p>"],
"smtp_account_id": 812
}
}

Validation & behaviorโ€‹

  • Structurally identical to send_email, plus the optional record_collection reference: the action sends one email per record in the collection.
  • The discovery schema serves to_address and subject as required; the typed DTO carries every template field as optional and the mapper fills the empty template ([]) when omitted (beta โ€” see meta/action).
  • With record_collection omitted, the action consumes the record collection bound by the enclosing for-loop.
  • Every other address/name/body template defaults to empty; attach_files_variable_defs defaults to [], attach_files_match_type to all, and attach_files_match_condition to the empty "match all" condition.
  • With smtp_account_id omitted, the send uses the organization's default SMTP account. Automation email sends draw down the organization's shared 24-hour send quota.

See alsoโ€‹