Skip to main content

Implement email in your AI Agent

After activating email in your AI Agent and setting up handoffs, and testing your email setup to ensure it's working properly, you can implement email so your AI Agent can start addressing your customer inquiries.

note

Your AI Agent can currently only respond on behalf of one email address.

Forward your support emails to Ada

There are two main ways to forward your email support inquiries to your email AI Agent:

  • Direct email: As soon as a customer sends an email to your company's support email address, forward it to your AI Agent.
  • Via API: Use Ada's Webform API to send email inquiries from contact forms or your agent platform to your AI Agent. This can be useful for use cases like:
    • When your customers fill out an existing form hosted on your website. You can do this with various types of forms, like Zendesk ticket forms or Salesforce contact forms.
    • Submitting your support ticket backlog to your AI Agent
    • Other systems customers can use to start email conversations

You can use either approach, or set up a custom combination of the input options to create an implementation that works well with your current email support flow. In this section, we'll provide you with some example implementation options as a starting point.

Direct email

With this method of implementation, customers will send inquiries to your support email, inquiries will be forwarded to your AI Agent, and your AI Agent will respond from your support email address.

BenefitsThings to consider
You can set custom forwarding rules, routing only a percentage of your conversations to your AI AgentUnless you have percentage-based routing rules in your forwarding setup, 100% of the emails that your customers send to your support email address will be forwarded to your AI Agent to respond to.
You can set up spam filtering as part of your forwarding rules, so you can prevent spam conversations from being forwarded to your AI Agent.Currently, your AI Agent can only be configured with one email address; if you have multiple support email addresses, you will need to choose one to generate DNS records for. Your AI Agent will respond to your customers with the address you configure.
If you don't set up DNS records in your domain configurations, your AI Agent will respond to your customers from its Ada-provided email address (not your support email).
If at any time you wish to stop your AI Agent from handling responses, you can stop forwarding emails to it.
Make sure the support email address you use for your AI Agent is publicly available to your customers.

Send emails to your AI Agent via API

Your AI Agent can receive customer inquiries through API calls, and respond over email.

To set up a form, you'll have to use a form provider (e.g., Zendesk) or set up your own system that can make a POST API call when a customer fills in the form. This call sends the contents of the form to your AI Agent via Ada's Webform API. Then, your AI Agent can reply to the customer via email.

BenefitsThings to consider
You can control the number and type of contact form inquiries that get sent to your AI Agent to resolve, using tagging, submission topic dropdowns, or volume configurations built into your agent platform.

Your AI Agent will reach out to the customer's email address that was provided in the contact form. Subsequent back-and-forths will occur in an email thread.

These back-and-forths occurring over email don't get synced into your agent platform.

You can also pass metadata through the Webform API. Passing metadata creates metavariables in the dashboard that you can leverage to configure your AI Agent (e.g., making rules based on an informational field you pass).Ada's Webform API doesn't support passing attachments; you have to exclude contact form inquiries that have attachments when configuring your trigger for the API call.

Because email forwarding is required for this implementation option, if it's also the email that you use for direct email inquiries, those will also get routed to your AI Agent to resolve.

If you wish to omit direct emails from your AI Agent's scope to resolve, we recommend you set up a different email address for contact form handling, and that you don't expose that address publicly to customers to reach out to.

The same DNS record/forwarding instructions apply to the setup for this separate email address.

Use the Webform API

Ada exposes an API to receive webform content and initiate an email conversation with the customer. You can make POST calls to this endpoint, replacing {bothandle} with your AI Agent's handle:

https://{bothandle}.ada.support/api/email/webform

To authenticate your call, find the API key:

  1. On the Ada dashboard, go to Channels > Email, then click the Configuration tab.
  2. Under Webform, copy the API key.
  3. When you're creating your API call, add the key into your header. Use the authentication type API key, use the key name x-auth-key, and paste your key as the Value.

Here's an example payload for the call:

{
"name": "FirstName LastName",
"text": "Email body",
"subject": "Email subject",
"reply_as" : "[email protected]",
"reply_to": "[email protected]",
"metadata": {
"ticket_id": "1001"
}
}

For your payload, use these fields. If it contains any additional fields, your AI Agent will ignore them:

FieldRequiredTypeDetails
nameYesStringThe customer's full name
textYesStringThe customer's inquiry, limited to 4096 characters
subjectYesStringThe subject of the customer's inquiry; used as the subject for your AI Agent's reply
reply_asYesStringThe company email address you want to use to reply to the customer. Your AI Agent can only use email addresses you've set up in your bring your own domain settings
reply_toYesStringThe customer's email address
metadataNo

Object

Key: string

Value: string, boolean, integer

Any metadata associated with the conversation, up to 4 KB. All metadata passed through this field will appear as metavariables in your dashboard.
note

If multiple API calls use the same subject and reply_to values, your AI Agent treats those calls as belonging to the same conversation.

If your call is successful, you should get a 204 response without any body content.

Open an accordion to see an example workflow of configuring Zendesk or Salesforce to work with the API.

tip

By default, external tools don't validate email addresses before performing actions. You may want to consider adding additional rules or conditions in your AI Agent if you need it to behave differently based on the customer's email address.

Example: Set up Zendesk ticket forms with the API

You can configure a Zendesk ticket form, and create a webhook and trigger to automatically forward content your customers submit to your AI Agent.

  1. Create a webhook

    Follow Zendesk's instructions on creating a webhook, so you can use Zendesk to point to Ada's API.

    • When you're configuring your endpoint URL, use https://{bothandle}.ada.support/api/email/webform, replacing {bothandle} with your own bot handle.
    • When you're adding your API key, add it to the header with the name x-auth-key, and for the value, paste in the API key you got in the Ada dashboard.

    When the webhook is configured, it should look like this:

  2. Create a trigger

    Follow Zendesk's instructions on creating ticket triggers, so Zendesk can automatically call your webhook as soon as it receives a response to your form.

    • We recommend these conditions:

      • Ticket > Ticket Is Created
      • Ticket > Attachment Is not Present
      • Ticket > Form Is Default Ticket Form

    • For your trigger actions, you can have any combination of actions, but we recommend using these two:

      • Call your webhook
        1. Click Add action > Notify by > Active webhook.

        2. Select the webhook you created.

        3. For the JSON body, use the following. Make sure to replace the reply_as address with your AI Agent's Ada-provided email address (help@{bothandle}.email.ada.support).

          {
          "name":"{{ticket.requester.name}}",
          "reply_to":"{{ticket.requester.email}}",
          "reply_as":"[email protected]",
          "subject":"{{ticket.title}}",
          "text":"{{ticket.latest_public_comment}}",
          "metadata": {
          "ticket_id": "{{ticket.id}}"
          }
          }
      • Close your ticket
        1. Click Add action > Status category.
        2. Select Closed.

      With the two above actions, your configuration should look like this:

Example: Set up Salesforce contact forms with the API

You can create a Salesforce case form, and create an automated process to automatically forward content your customers submit to your AI Agent. You, or someone with Salesforce Admin permissions, can

  1. Set up your Salesforce case fields
    1. Add your Ada email as a case origin you can track in Salesforce, so you can track which cases were passed to your AI Agent. Follow Salesforce's instructions in Add Picklist Values. For your Cases, in the Case Origin field, add a picklist value with your Ada-provided email address (help@{bothandle}.email.ada.support) as the value.
    2. Create a new checkbox, so your automation flow can track which cases it's already sent to Ada and doesn't send duplicates. Follow Salesforce's instructions in Create Custom Fields, and create a checkbox with the following attributes:
      • Type: Checkbox; default unchecked
      • Name: Sent to Ada
      • Visible to all users
      • Read-only for all users except System Administrators profile
      • Do not add to layout
    3. Click Save.
  2. Set up a flow to send case data to Ada
    1. Add your API credentials to Salesforce so it can use Ada's API to send over email data. Follow Salesforce's instructions to Create or Edit a Basic Authentication External Credential, and enter the following information:

      • Label: Ada Email API External Credential
      • Name: AdaEmailAPIExternalCredential
      • Authentication Protocol: No Authentication

      Additionally, follow the instructions in the above link to create a principal, to act as a user for the credentials you just made. Use the following information:

      • Parameter Name: User
      • Sequence Number: 1
      • Identity Type: Named Principal
    2. Instead of putting your authentication in the credentials, add a custom header. Follow Salesforce's instructions to Create and Edit Custom Headers, and enter the following information:

      • Name: x-auth-key
      • Value: Paste in the API key you got in the Ada dashboard.
      • Sequence Number: 1
    3. Create a permission set, so you can share the credentials you just made with other admins. Follow Salesforce's instructions to Create Permission Sets, and do the following:

      • Name: Ada Email Http Callout
      • Click External Credential Principal Access, then add the Ada Email API External Credential you created
      • Follow Salesforce's instructions to Manage Permission Set Assignments to assign the new permission set to yourself and any other admins
    4. Create a named credential. Follow Salesforce's instructions to Create or Edit a Named Credential, and enter the following information:

      • Label: Ada Email API Named Credential
      • Name: AdaEmailAPINamedCredential
      • URL: https://{bothandle}.ada.support/api/email/webform, replacing {bothandle} with your AI Agent's handle
      • Under Authentication, under External Credential, select the Ada Email API External Credential you created earlier
  3. Create a flow to automate closing cases
    1. Create a flow to update the case's status to Closed. Follow Salesforce's instructions to Build a Flow, and do the following:
      • Create a Record-Triggered Flow
      • Object: Case
      • Trigger the Flow When: A record is created or updated
      • Condition Requirements: All Conditions are Met (AND)
        • Origin Equals Ada Email
        • Status Does Not Equal Closed
      • When to Run the Flow for Updated Records: Every time a record is updated and meets the condition requirements
      • Optimize the Flow for: Fast Field Updates
    2. Add an Update Triggering Record element to the flow. In the New Update Records window, enter the following information:
      • Label: Update Status
      • API Name: Update_Status
      • How to Find Records to Update and Set Their Values: Use the case record that triggered the flow
      • Condition Requirements to Update Record: None - Always Update Record
      • Field: Status
      • Value: Closed
    3. Save and activate your flow, giving it a name like CASE: Update Ada Email Status to Closed.
  4. Create a flow to automate sending cases to Ada, using an HTTP callout
    1. Create a new flow to automatically send cases to Ada. Follow Salesforce's instructions to Build a Flow, and do the following:

      • Create a Record-Triggered Flow
      • Object: Case
      • Trigger the Flow When: A record is created or updated
      • Condition Requirements: All Conditions are Met (AND)
        • Origin Equals Ada Email
        • Status Does Not Equal Closed
        • Sent_to_ada__c Equals False
      • When to Run the Flow for Updated Records: Only when a record is updated to meet the condition requirements
      • Optimize the Flow for: Actions and Related Records
    2. Add a scheduled path to the flow. Follow Salesforce's instructions to create Scheduled Paths, and add the following information:

      • Path Label: API to Ada
      • API Name: API_to_Ada
      • Time Source: Case: Last Modified Date
      • Offset Number: 1
      • Offset Options: Minutes After
      • Advanced > Batch Size: 1
    3. Add an HTTP callout to the flow. Follow Salesforce's instructions to Configure an HTTP Callout Action, and add the following information:

      1. External service configuration:
        • Category: HTTP Callout
        • Named Credential: Ada Email API Named Credential
      2. Invocable action:
        • Label: Ada Email Invocable Action
        • Method: POST
        • Sample JSON request:
          {
          "name":"{{ticket.requester.name}}",
          "reply_to":"{{ticket.requester.email}}",
          "reply_as":"[email protected]",
          "subject":"{{ticket.title}}",
          "text":"{{ticket.latest_public_comment}}",
          "metadata": {
          "ticket_id": "{{ticket.id}}"
          }
          }
        • Sample response body: Not required

      This creates an Apex class variable that you can use in step e, so you can specify individual dynamic fields to send.

    4. Now that you've configured the action, add it to your flow, so you can use the API callout to send cases to Ada. Use the following information:

      • Name: Send to Ada
      • API Name: SendtoAda
      • Body: Apex-Defined Variable
      • Value: Create a variable called AdaEmailBody
    5. In your flow, add an assignment element before the action element you just added. You can see an example at Salesforce's Flow Element: Assignment topic. Enter the following information:

      • Label: Set Body Variables
      • API Name: Set_Body_Variables

      Then, add each of the following variables by choosing the Apex-defined variable you created above, then the corresponding fields in your Salesforce case:

      • AdaEmailBody > name Equals $Record > Name
      • Optional: AdaEmailBody > replyx5fas Equals [email protected]
      • AdaEmailBody > replyx5fto Equals $Record > Email Address
      • AdaEmailBody > subject Equals $Record > Subject
      • AdaEmailBody > text Equals $Record > Description
      • AdaEmailBody > metadata > ticket Equals $Record > Case ID

      Ensure that all of the above values are on your case creation form, with the exception of your reply-as email.

    6. Add an Update Triggering Record element to the flow. In the New Update Records window, enter the following information:

      • Label: Update Sent to Ada checkbox on Case
      • API Name: Update_Sent_to_Ada_checkbox_on_Case
      • How to Find Records to Update and Set Their Values: Use the case record that triggered the flow
      • Condition Requirements to Update Record: None - Always Update Record
      • Field: Sent_to_Ada__c
      • Value: True
    7. Save and activate your flow, giving it a name like CASE: Send to Ada Email.

  5. Test your flow. Create a case with a Case Origin of Ada Email, and use a valid email address to test. You should be able to see the conversation appear in Ada, and get a reply at the email address you provided.

Implementation examples

Hybrid Implementation: Direct email + contact forms

You can use both direct email and contact forms to handle inquiries on both fronts, expanding your AI Agent's scope of responsibility.

BenefitsThings to consider
Maximize your AI Agent's oversight, handling even more inquiries automatically, and reducing the strain on your live agents.Your AI Agent will automatically create tickets in your agent platform for inquiries that originated from a contact form, but it won't make tickets for inquiries over direct email.

Agent platform tickets

If you use any alternate methods to create tickets in your agent platform (outside of contact forms or direct emails), you can use the Webform API to route tickets from your Agent platform to your AI Agent.

Implementation notes

  • Regardless of a conversation's implementation method (direct email, contact forms, agent platform tickets), you can view conversation transcripts in the Conversations section of the Ada dashboard.
    • However, if a conversation happens in an email thread, that conversation won't appear in your agent platform, unless a handoff with a transcript occurs.
  • If a conversation starts with your agent platform and later gets handed off, the handoff doesn't update the original ticket.
  • Ada has a Zendesk Conversation Solution sync available if you need to sync contained conversations that your AI Agent was able to handle without handoff back into Zendesk. Contact your Ada team to learn more.

Configure your custom email address

Regardless of which implementation method you choose, you'll have to:

  • Set up your email domain, so that your AI Agent can respond to customer inquiries on behalf of your support email address.
  • Set up email forwarding to your AI Agent's email address, to ensure that your AI Agent is receiving all the inquiries meant to go its way.

Bring your own domain

You can use an address from your own email domain. To do so, you'll need to get your IT team to go into your domain provider configuration settings to add three CNAME records and one TXT record.

  1. On the Ada dashboard, go to Channels > Email, then click the Configuration tab.

  2. Under Bring your own domain, enter the email address that uses your own domain (e.g., [email protected]), then click Next. The CNAME and TXT records you need to activate the email address appear.

  3. Coordinate with your IT team to get those records added to your domain. After they've been added, select the I've added these records check box, then click Verify. As soon as Ada receives verification status confirmation, your AI Agent displays the verified status on the dashboard, and you can proceed to set up email forwarding.

Set up email forwarding

You can configure email forwarding in multiple ways, depending on your email provider and access rights.

Consult with your IT team to set this up. Note that you need to enable SMTP forwarding outside of your company domain (e.g., add email.ada.support to your domain allowlist) to forward email to Ada.

For example, if your organization uses Google Workspace, you can follow Google's instructions on setting up default routing, so emails that go to your help address also get delivered to your AI Agent's Ada-provided email address (help@{bothandle}.email.ada.support).

Test your implementations

We recommend testing any implementations you've configured to ensure that your customers' emails and attachments get successfully delivered to your AI Agent. For example, if you've configured a web for that passes content to your AI Agent using the API, try filling in that form and verifying that your AI Agent responds properly to the provided email address.