> ## Documentation Index
> Fetch the complete documentation index at: https://docs.invoca.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Creating Emails from Signals: SMS / Voice Agent Lead Intake

> Three ways to turn an SMS or Voice AI agent's lead-capture Signal into an email notification, plus how to attach custom values to the email body.

**Before you begin:** the underlying platform features referenced here (SMS Agent Lead Capture Email, Post Call Email) are in private beta. This beta status refers only to the email notification functionality described in this guide — it does not apply to Invoca's AI Messaging Agent (SMS/Voice) itself. Availability may require enablement by Invoca's Integrations team. Reach out to your account team or [support@invoca.com](mailto:support@invoca.com) if you have questions.

When an Invoca SMS or Voice AI agent captures a lead (name, email, callback number, and similar), that capture is recorded as a Signal on the call or conversation record, typically alongside Marketing Data fields holding the actual values the agent collected. To notify a person or team by email when this happens, Invoca offers more than one mechanism. This guide explains each one, how they differ, and how to attach custom values to the email content.

A note on the two email actions: SMS Agent Lead Capture Email and Post Call Email are two presets of the same underlying "Email" integration, not independent features. The choice between them is about targeting and available body fields, not a different integration.

## The three ways to get an email out of a Signal

| Method                          | What it is                                                                                               | Trigger                                                                                          | Real-time?                        | Where it's configured                          |
| :------------------------------ | :------------------------------------------------------------------------------------------------------- | :----------------------------------------------------------------------------------------------- | :-------------------------------- | :--------------------------------------------- |
| 1. SMS Agent Lead Capture Email | A pre-built "Existing Type" action under the Email integration tile, purpose-built for SMS agent Signals | A specific Signal (for example, "Lead Capture via SMS Agent," "SMS Engaged") or "all profiles"   | Yes — fires per call/conversation | Integrations library → Email tile → New Action |
| 2. Post Call Email              | The same Email integration tile, using the "Post Call Email" Existing Type action                        | All calls, paid calls only, or a specific Signal                                                 | Yes — fires per call              | Integrations library → Email tile → New Action |
| 3. Custom Email Data Delivery   | A scheduled report (CSV/attachment) emailed on a recurring schedule                                      | Not Signal-triggered; batch export of Calls/Transactions report data (can be filtered by Signal) | No — daily/weekly/monthly batch   | Submitted via a support case                   |

There's also a fourth pattern worth knowing about, even though it isn't literally an "Email" action in the Invoca UI: a **Post-Call Webhook** fired off the lead-capture Signal, sent to a CRM or third-party email/marketing tool (for example, a CRM's Lead API or an email service provider's API), which then sends its own email. This is the pattern used in Invoca's "Agentic Lead Capture" architecture (Signal → Marketing Data → Post-Call Webhook → external system). Use this when the destination needs structured data (a CRM record) rather than a human-readable email, or when the email itself needs to be sent by a downstream system's templating and branding.

### Which one should I use?

Need a real-time email the moment a lead is captured, with call/lead details in the body? Use SMS Agent Lead Capture Email if the trigger is SMS-specific, or Post Call Email for broader targeting (all calls, paid calls, or any Signal — any Signal can be associated with either action). For Voice agent lead capture specifically, use Post Call Email — there's no Voice-specific "Lead Capture Email" action equivalent to the SMS one, and Post Call Email's template can be configured for Voice AI use cases.

Need a recurring digest or report of leads, rather than one email per lead? Use Custom Email Data Delivery.

Need the lead to land in a CRM, with a human-readable email as a secondary concern generated by the CRM's own workflow? Use the Post-Call Webhook pattern.

## Methods 1 & 2: Email integration actions (real-time, per-Signal)

Both the SMS Agent Lead Capture Email and Post Call Email actions live under the same Email integration tile and are configured almost identically.

### Setup

1. Go to the Integrations library for the network.
2. Click the **Email** tile to integrate.
3. Click to add a **New Action**.
4. Select **Existing Type**.
5. Select **SMS Agent Lead Capture** or **Post Call Email** as the action type.
6. Select "Send SMS Agent Lead Capture Email - one recipient" (for SMS Agent Lead Capture) or "Send Post Call Email - one recipient" (for Post Call Email).

### Configuration options

| Field                        | Notes                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| :--------------------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Targeting                    | SMS Agent Lead Capture Email: target a specific profile (or all profiles) and any Signal — any Signal can be associated with the action, though SMS-specific Signals fit best (for example, SMS Engaged, SMS Callback Scheduled, Lead Capture via SMS Agent, SMS Callback). Post Call Email: target a profile (or all), and choose all calls, paid calls only, or a specific Signal.                                                                                                                                                                                                                                                                                                     |
| Email subject                | Free text.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| Email recipient              | Address plus friendly name. Only one email address is supported per action. Workarounds: (a) create multiple actions targeted by profile/Signal, one per recipient; (b) store a `notification_email_address` field in Marketing Data (varying by location or destination number, for example) and reference it via the substitution picker in the "To" field; or (c) for Post Call Email only, use its experimental/internal-only multi-recipient mode — select the "multi recipient" action type and pass a JSON array of email objects (see example below). Wrap Marketing-Data-sourced arrays in the `json_parse` helper. This mode isn't available for SMS Agent Lead Capture Email. |
| Email title (in body)        | Hard-coded text, or the profile/campaign name, or a Marketing Data field. If using a Marketing Data field, use the `if_nil` helper for a fallback — for example, `<location_name.if_nil("Your Company Name")>`.                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| Interaction/Call URL         | To include a working hyperlink back to the call/interaction report, paste the exact snippet below into the action, filling in your network domain and network ID. Everything except the "View details:" label is fixed syntax and must not be altered — see the code block below.                                                                                                                                                                                                                                                                                                                                                                                                        |
| SMS Fields (SMS action only) | Up to 6 slots for additional Marketing Data fields captured dynamically from the customer/lead, inserted into the email body.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |

**Interaction/Call URL snippet:**

```text theme={null}
View details: <complete_call_id.add_prefix('<a href=https://<NETWORK DOMAIN>/networks/<NETWORK ID>/reports/details/calls/ui/list/')><complete_call_id.add_prefix('/details>')></a>
```

**Multi-recipient JSON example (Post Call Email only):**

```json theme={null}
[{"email": "demo@invoca.com", "name": "Jane"}]
```

### Content customization

The body and template content of these emails currently isn't customizable without Invoca developer support. Only the fields listed above — subject, recipient, title, interaction URL, and SMS fields — are configurable.

## Attaching custom variables and values to the email

The "custom variables" in these emails are Invoca Marketing Data fields — the mechanism the platform uses generally for dynamic call/lead attribution, not something unique to the Email action.

### 1. Create the Marketing Data fields

Go to **Settings** → **Marketing Data**. Create a field for each piece of data you want to capture and later reference in the email (for example, `consumer_first_name`, `consumer_last_name`, `consumer_email`).

Each field has a Partner (API) name, used in substitution syntax (for example, `<consumer_email>`), and an optional Friendly Name used in the UI picker.

Field name rules: the partner name may only contain letters, numbers, underscores, and hyphens.

### 2. Get values into the fields

For the SMS/Voice agent use case, the agent populates these fields at the moment it captures lead data, typically alongside firing the Signal — for example, via the FlexibleSignalAPI tool, configured with the Signal name and the list of Marketing Data fields the agent should collect:

```json theme={null}
[
  {"name": "consumer_first_name", "description": "The first name extracted from the user's input (Required)"},
  {"name": "consumer_last_name", "description": "The last name extracted from the user's input (Required)"},
  {"name": "consumer_email", "description": "The email address extracted from the user's input (Required). Must be a valid email address."}
]
```

This is the same Signal plus Marketing Data combination referenced in Invoca's Agentic Lead Capture setup guide, which also feeds a Post-Call Webhook to a CRM in parallel — the Signal/Marketing Data layer is shared infrastructure regardless of whether the "consumer" of that data is an Email action, a webhook, or a Data Delivery.

### 3. Reference the fields in the email action

In the SMS Agent Lead Capture Email action, use the SMS Fields slots (up to 6) to pick which Marketing Data fields appear in the body, via the substitution picker.

In the Post Call Email action, Marketing Data fields can be inserted into the subject, title, or recipient fields using the same picker — the field is inserted as `<partner_name>`.

Useful formatting and safety helpers to wrap around a substitution parameter:

* `if_nil("fallback")` — supply a fallback value if the field is empty, for example `<location_name.if_nil("Your Company Name")>`
* `json_parse` — unescape a JSON-formatted Marketing Data value (needed for the experimental multi-recipient array)
* `add_prefix` — confirmed working (used in the interaction/call URL snippet above)
* The email actions run through the same `parameter_substitution` engine used by webhooks, so other helpers documented for webhook formatting (`lower`, `upper`, `left`, `right`, `mid`, `compare_string`, `blank_if_nil`, `md5`, `sha256`, `date_time_strftime`, `phone_number`, `cgi_unescape`, `in_timezone`, and similar) should work the same way — but they aren't explicitly documented for email actions, so test or confirm with Invoca's Integrations team before relying on them.

## Known limitations

* Only one recipient email address per action (multi-recipient is experimental/internal-only for Post Call Email; not available for SMS Agent Lead Capture Email).
* Email body and template content is fixed, and isn't customizable per customer without engineering involvement.
* Both email actions are in private beta — this refers only to the email notification functionality, not to Invoca's AI Messaging Agent itself. No public rollout timeline exists yet; support and rollout go through Invoca's Integrations team.
* Data Deliveries (batch email of a report) aren't real-time and can't compute formula values, such as a count of how many Signals fired on a call.

## Where to go next

* [AI Messaging Agent: Lead Form Follow-Up Guide](/s/article/ai-messaging-agent-lead-form-followup)
* [Signal Management: Manual Result Overrides](/s/article/signal-management-manual-result-overrides)
