SendEmailInformation

The SendEmailInformation action sends an informational email to a user during or after a conversation. The AI Employee analyzes the conversation to determine whether an email should be sent, validates the recipient's email address and consent, checks for duplicates, and generates the email content from pre-configured templates.

Triggering event:

  • send_email_tool — Triggered when the AI Employee determines an email should be sent to the user.

How it works

  1. The action checks whether the user has previously opted out of emails (email_subscribed persona attribute).
    • If opted out, the action asks the user for consent before proceeding.
    • If consent is granted, email_subscribed is updated to "true".
  2. The action generates a schema from the allowed email templates.
  3. It analyzes the conversation to validate:
    • The user's email address is available.
    • The user confirmed the email address is correct (or the agent promised to send).
    • The agent explicitly stated it will send an email.
    • Similar content has not already been sent (duplicate check).
    • The content matches an allowed template.
  4. If validation passes:
    • The email subject and body are extracted from the matching template.
    • Placeholders are replaced with actual data from the conversation.
    • Lines with unfilled placeholders are removed.
    • The content is translated to the agent's language if needed.
  5. The action sends an email_worker_send_email system event with the recipient email, subject, and HTML body.
  6. The sent email is tracked in the email_already_sent_information persona attribute to prevent duplicates.
  7. The follow-up timer is extended to 60 seconds to prevent the agent from speaking immediately after sending.

Configuration

AttributeDescription
project_attributes_setting_email_send_information_enabledSet to "True" to enable email sending.
project_attributes_setting_email_send_information_allowed_contentDefines allowed email templates and their content structure.
project_business_time_zoneTime zone for datetime formatting in email content.

Consent management

The action tracks email consent per user through the email_subscribed persona attribute:

ValueBehavior
"true"User has consented. Emails are sent without asking.
"false"User has opted out. The action asks for consent before sending.
Not setFirst interaction. The action proceeds normally.

If a user has opted out and the agent needs to send an email, the action sends an urgent message asking the user for permission. Only if the user agrees does the action proceed and update the consent status.

Persona attributes

AttributeDescription
email_subscribedTracks whether the user has consented to receive emails.
email_already_sent_informationTracks previously sent email content to prevent duplicates.

System event sent

SendSystemEvent(
  eventIdn="email_worker_send_email",
  connectorIdn="system",
  email="[email protected]",
  cc=" ",
  subject="Your reservation confirmation",
  body="<html>...</html>",
  notify="true"
)

Analysis output

The structured generation produces a JSON object with the following fields:

FieldTypeDescription
user_email_presenceBooleanWhether the user's email address is available.
user_correctness_agreementBooleanWhether the user confirmed the email is correct.
convo_agent_promiseBooleanWhether the agent explicitly promised to send an email.
email_subjectStringThe subject line for the email.
email_bodyStringThe HTML body of the email.
is_duplicateBooleanWhether similar content was already sent.
information_is_allowed_to_be_sentBooleanWhether the content matches an allowed template.
agent_must_send_emailBooleanFinal decision: true if the email should be sent.

Example

Enable email sending and configure an allowed template for appointment confirmations:

project_attributes_setting_email_send_information_enabled = "True"

Configure an allowed email template with placeholders:

project_attributes_setting_email_send_information_allowed_content = {
  "appointment_confirmation": {
    "subject": "Your appointment at [business_name]",
    "body": "<p>Hi,</p><p>Your appointment is confirmed for [appointment_date] at [appointment_time].</p><p>Address: [address]</p><p>See you there!</p>"
  }
}

When the AI Employee confirms an appointment during a call, it automatically sends a confirmation email to the user with the relevant details filled in from the conversation.