Skip to content

send_email_to_caller

The send_email_to_caller tool sends an email to the person who called. The AI orchestrator composes the subject and body based on the task and call transcription. The recipient is always resolved from the system — never chosen by the AI.

Available during todo execution when the TodoType has SendEmailToCaller in its tools list. Organizations configure this when creating todo types.

Tool {
name: "send_email_to_caller",
description: "Sends an email to the caller. The recipient is automatically
derived from the contact associated with the call.",
input_schema: SendEmailToCallerInput {
subject: String, // The email subject line
body: String, // The email body (plain text)
},
}

The AI orchestrator provides subject and body. The recipient email comes from the contact record linked to the call.

AI calls send_email_to_caller({ subject: "...", body: "..." })
→ Look up call → get contact_id
→ Query contact_email (ordered by is_preferred DESC) → get recipient
→ Send via bases::email::send_email
→ Return "Email sent successfully to the caller."
  1. Fetch the call’s contact_id (error if no contact linked)
  2. Query contact_email filtered by contact_id, ordered by is_preferred DESC
  3. Take the first result as the recipient (error if no email on file)
ConditionResult
No contact_id on the callError returned to AI agent
No email address for contactError returned to AI agent
Email send failureError propagated, todo marked as failed