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
- The action checks whether the user has previously opted out of emails (
email_subscribedpersona attribute).- If opted out, the action asks the user for consent before proceeding.
- If consent is granted,
email_subscribedis updated to"true".
- The action generates a schema from the allowed email templates.
- 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.
- 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.
- The action sends an
email_worker_send_emailsystem event with the recipient email, subject, and HTML body. - The sent email is tracked in the
email_already_sent_informationpersona attribute to prevent duplicates. - The follow-up timer is extended to 60 seconds to prevent the agent from speaking immediately after sending.
Configuration
| Attribute | Description |
|---|---|
project_attributes_setting_email_send_information_enabled | Set to "True" to enable email sending. |
project_attributes_setting_email_send_information_allowed_content | Defines allowed email templates and their content structure. |
project_business_time_zone | Time zone for datetime formatting in email content. |
Consent management
The action tracks email consent per user through the email_subscribed persona attribute:
| Value | Behavior |
|---|---|
"true" | User has consented. Emails are sent without asking. |
"false" | User has opted out. The action asks for consent before sending. |
| Not set | First 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
| Attribute | Description |
|---|---|
email_subscribed | Tracks whether the user has consented to receive emails. |
email_already_sent_information | Tracks 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:
| Field | Type | Description |
|---|---|---|
user_email_presence | Boolean | Whether the user's email address is available. |
user_correctness_agreement | Boolean | Whether the user confirmed the email is correct. |
convo_agent_promise | Boolean | Whether the agent explicitly promised to send an email. |
email_subject | String | The subject line for the email. |
email_body | String | The HTML body of the email. |
is_duplicate | Boolean | Whether similar content was already sent. |
information_is_allowed_to_be_sent | Boolean | Whether the content matches an allowed template. |
agent_must_send_email | Boolean | Final 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.
Updated 1 day ago
