Skip to main content

How Email works

Use Email when you want the agent to execute a preconfigured email action. The agent decides when to use the tool, while you control the sender, subject, and body defaults in the builder. This gives you full control over the messaging content while letting the agent handle timing and recipient selection based on real-time context. Email is ideal when your copy is already approved and consistent messaging matters more than personalization. Because all content is builder-defined, the agent cannot modify the email body — it simply triggers delivery when conditions are met during the run.

Configuration

Inputs

string
Instructions that define when this tool should be used.
string
required
Flywheel user ID to receive the email.
string
required
Sender configuration to use for delivery.
string
Subject used for this message.
string
Optional email preview text.
string[]
Optional CC recipients.
string[]
Optional BCC recipients.
boolean
default:"true"
Whether the run should continue when send fails.

Outputs

enum
required
The status of the email send operation. Can be success, failure, or skipped.
string
required
The ID of the user that the email was sent to.
string
required
The ID of the sender configuration used for the email.
string
The ID of the email that was sent (available on success).
object
The options used when creating the email, including subject, preview text, and recipients (available on success).
object
The response from the email creation service (available on success).
enum
The code indicating why the email send operation failed or was skipped. Can be resend_error, duplicate_email, or user_marketing_email_opt_out.
string
The message of the error that occurred (available on failure).

Use cases

Onboarding Completion
High-Intent Follow-Up
Renewal Reminder
Feature Adoption Nudge

Best practices

Content Control
  • Keep all email content builder-defined to ensure brand consistency and compliance review.
  • Use this tool instead of AI-generated variants when the copy must match an approved template exactly.
  • Pair with preview text to improve open rates in inbox clients.
Failure Handling
  • Enable complete_on_send_failure when the agent run should proceed even if the email fails.
  • Monitor code output values like duplicate_email and user_marketing_email_opt_out to understand skip reasons.
  • Log error_message output for debugging delivery issues in BetterStack.
Targeting and Timing
  • Use the agent prompt to define clear conditions for when this tool should fire during a run.
  • Avoid sending duplicate emails by checking recent send history through agent context.
  • Combine with other tools like Set Custom Property to mark users after email delivery.