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

# Post-Call Email Automation

> Learn how to automatically send personalized emails to customers after AI phone calls

This tutorial shows how to set up an automation that sends personalized follow-up emails to customers after AI phone calls, with conditional logic based on call outcomes and personalized content.

<iframe width="100%" height="400" src="https://www.youtube.com/embed/f0b7cMXqWWI?si=9Ic3VHwV-QeL5YER" title="Tutorial: How to send an email after phone call ends" frameBorder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowFullScreen />

## What You'll Learn

* Setting up post-call email automation with conditional triggers
* Configuring email templates with dynamic content from calls
* Mapping call data and variables to email content
* Creating different email flows based on call success
* Best practices for professional follow-up communication

## Prerequisites

* Configured AI assistant with post-call variables and email collection
* Email service integration (Gmail)
* Understanding of post-call webhook automation
* Access to call testing functionality

## Step 1: Create Post-Call Email Automation

We'll create an automation that triggers after phone calls and sends personalized emails based on call outcomes.

<video autoPlay muted loop playsinline src="https://mintcdn.com/autocalls/ehX36KEpVzCQtCBE/resources/tutorials/post-call-email/01-create-email-automation.mp4?fit=max&auto=format&n=ehX36KEpVzCQtCBE&q=85&s=1b3c41da3e2a4b57010513bc5dc95540" data-path="resources/tutorials/post-call-email/01-create-email-automation.mp4" />

1. **Navigate to Automation Platform**
2. **Create a new flow** from scratch
3. **Search for your calling platform** in triggers
4. **Select "Phone Call Ended"** trigger
   * This captures data from all completed calls to your selected assistant

## Step 2: Configure Assistant and Load Data

<video autoPlay muted loop playsinline src="https://mintcdn.com/autocalls/ehX36KEpVzCQtCBE/resources/tutorials/post-call-email/03-select-assistant-for-email.mp4?fit=max&auto=format&n=ehX36KEpVzCQtCBE&q=85&s=97c30787ed3396aa4fd294588ccbe610" data-path="resources/tutorials/post-call-email/03-select-assistant-for-email.mp4" />

1. **Select your target assistant**
   * Each assistant supports only one post-call automation
   * All calls to this assistant will trigger this email flow
2. **Click "Load Data"** to set up the webhook and load sample call data
   * This automatically configures the webhook on your assistant
   * Sample data from your recent calls will be loaded for use in the next steps

## Step 3: Verify Assistant Variables

Before proceeding, make sure your assistant has the right variables configured:

1. **Check post-call variables** in your assistant's "Post-call Actions" tab:
   * **status**: Boolean indicating call success
   * **email**: Customer email address
   * Add any other variables you want to use in your email

<Frame>
  <img src="https://mintcdn.com/autocalls/ehX36KEpVzCQtCBE/resources/tutorials/post-call-email/07-post-call-variables.png?fit=max&auto=format&n=ehX36KEpVzCQtCBE&q=85&s=7a091d091e34269af70581ac041b6e06" alt="Post-call variables for email content" width="1749" height="763" data-path="resources/tutorials/post-call-email/07-post-call-variables.png" />
</Frame>

2. **Check input variables** in your assistant's "Prompt & Tools" tab:
   * Ensure `email` variable is defined so the assistant collects it during calls

<Frame>
  <img src="https://mintcdn.com/autocalls/ehX36KEpVzCQtCBE/resources/tutorials/post-call-email/08-set-test-values.png?fit=max&auto=format&n=ehX36KEpVzCQtCBE&q=85&s=1e03232eb0d0a6a8f1bc8cc489871abe" alt="Call variables including email collection" width="935" height="861" data-path="resources/tutorials/post-call-email/08-set-test-values.png" />
</Frame>

### Adding New Post-Call Variables

If you add a new post-call variable after creating the automation:

1. **Define the new variable** in your assistant's "Post-call Actions" tab and save
2. **Return to your automation** and click **"Load Data"** again to refresh the available fields
3. **Re-evaluate an existing call** if needed to extract the new variable from past calls

## Step 4: Configure Conditional Email Logic

We only want to send emails when the call objective was achieved.

<video autoPlay muted loop playsinline src="https://mintcdn.com/autocalls/ehX36KEpVzCQtCBE/resources/tutorials/post-call-email/13-add-branch.mp4?fit=max&auto=format&n=ehX36KEpVzCQtCBE&q=85&s=361b6f80c24ec2e4a471e5d94bb9a84d" data-path="resources/tutorials/post-call-email/13-add-branch.mp4" />

1. **Click the "+" sign** to add a step
2. **Search for "Branch"** in control flow
3. **Select Branch** to create conditional logic

<video autoPlay muted loop playsinline src="https://mintlify.s3.us-west-1.amazonaws.com/autocalls/resources/tutorials/post-call-email/14-configure-status-condition.mp4" />

4. **Configure the branch condition:**
   * **Select `status` variable** from call data
   * **Choose "Boolean is true"**
   * This creates two paths: True (qualified) and False (not qualified)

## Step 5: Set Up Email Service Integration

<video autoPlay muted loop playsinline src="https://mintcdn.com/autocalls/ehX36KEpVzCQtCBE/resources/tutorials/post-call-email/15-add-email-action.mp4?fit=max&auto=format&n=ehX36KEpVzCQtCBE&q=85&s=eda3a2b4a79b237e93430681065c0f54" data-path="resources/tutorials/post-call-email/15-add-email-action.mp4" />

1. **On the True branch**, click "+"
2. **Search for your email service** (Gmail, Outlook, SMTP, etc.)
3. **Select "Send Email"** action

<video autoPlay muted loop playsinline src="https://mintcdn.com/autocalls/ehX36KEpVzCQtCBE/resources/tutorials/post-call-email/16-create-email-connection.mp4?fit=max&auto=format&n=ehX36KEpVzCQtCBE&q=85&s=e727b9a4825d2cb7580d42de8df81d6f" data-path="resources/tutorials/post-call-email/16-create-email-connection.mp4" />

4. **Create email service connection:**
   * Authorize with your email provider
   * Configure SMTP settings if using custom email
   * Save the connection for future use

## Step 6: Configure Email Content and Recipients

<video autoPlay muted loop playsinline src="https://mintcdn.com/autocalls/ehX36KEpVzCQtCBE/resources/tutorials/post-call-email/17-map-recipient-email.mp4?fit=max&auto=format&n=ehX36KEpVzCQtCBE&q=85&s=97a50191e13b6f8415b06f048c31c817" data-path="resources/tutorials/post-call-email/17-map-recipient-email.mp4" />

1. **Configure recipient:**
   * Click on "To" email field
   * **Select customer email** from call variables
   * Ensure the email address is properly mapped

2. **Set email subject:**
   * Use dynamic content: "Thank you for your time, `{customer_name}`!"
   * Include company name or call reference
   * Keep subject professional and relevant

<video autoPlay muted loop playsinline src="https://mintcdn.com/autocalls/ehX36KEpVzCQtCBE/resources/tutorials/post-call-email/19-compose-email-body.mp4?fit=max&auto=format&n=ehX36KEpVzCQtCBE&q=85&s=06897dcbd51da008a712a6c735be6e5a" data-path="resources/tutorials/post-call-email/19-compose-email-body.mp4" />

1. **Compose email body with dynamic content:**
   * **Click on the "Body" field** to start writing your email
   * **Type your email content** with placeholders for variables
   * **Example email template:**

```
Hi {customer_name},

Thank you for taking the time to speak with us today. Here's a transcript of our conversation:

{formatted_transcript}

Next Steps:
- We'll follow up as discussed
- Feel free to reach out with any questions
- [Include specific next steps based on your business]

Best regards,
[Your Name/Company]
[Contact Information]
```

2. **Add dynamic variables to your email:**
   * **To replace `{customer_name}`**:
     * **Click where you want the variable** in your email text
     * **A popup will appear** with available variables
     * **Search for and select "customer\_name"** from call variables
     * **Click "Insert"** to add the variable
   * **To replace `{formatted_transcript}`**:
     * **Click where you want the transcript** in your email text
     * **Navigate to "Post Call Variables"** in the popup
     * **Select the "formatted\_transcript" variable**
     * **Click "Insert"** to add the variable

## Step 7: Advanced Email Templates

You can create more professional emails by using HTML formatting:

1. **Select "HTML" as body type** in your email action
2. **In the body field, add HTML code** for enhanced formatting
3. **Use dynamic variables** the same way as in plain text emails

## Step 8: Test Email Automation

<video autoPlay muted loop playsinline src="https://mintcdn.com/autocalls/ehX36KEpVzCQtCBE/resources/tutorials/post-call-email/22-test-email-sending.mp4?fit=max&auto=format&n=ehX36KEpVzCQtCBE&q=85&s=f75de04af91a6337a19f0562444e5cf7" data-path="resources/tutorials/post-call-email/22-test-email-sending.mp4" />

1. **Click "Test Step"** to send test email
2. **Verify successful delivery** in test results
3. **Check your email inbox:**
   * Verify email was received
   * Check that dynamic content populated correctly
   * Review formatting and professionalism

## Step 9: Publish and Monitor

<Frame>
  <img src="https://mintcdn.com/autocalls/ehX36KEpVzCQtCBE/resources/tutorials/post-call-email/25-publish-email-automation.png?fit=max&auto=format&n=ehX36KEpVzCQtCBE&q=85&s=fa5b7d19e298267ac58645e62ca6f804" alt="Publishing email automation" width="1758" height="676" data-path="resources/tutorials/post-call-email/25-publish-email-automation.png" />
</Frame>

1. **Click "Publish"** to activate your email automation
2. **Monitor automation runs** for successful email delivery

## Best Practices

### Email Content

* **Professional tone** appropriate for your industry
* **Clear subject lines** that indicate purpose
* **Personalized content** using call data effectively
* **Clear call-to-action** for next steps

## Troubleshooting

### Common Issues

**Emails not sending:**

* Verify email service connection and authorization
* Check that customer email addresses are valid
* Confirm email action is on correct conditional branch
* Verify automation is published and active

**Dynamic content not populating:**

* Check variable mapping in email template
* Verify post-call variables are being extracted correctly
* Ensure call variables contain email data
* Test with various call scenarios

Your customers will now receive professional, personalized follow-up emails after every successful call, improving relationship building and conversion rates!
