Skip to main content

How AI Marketing Email works

AI Marketing Email lets your agent generate the subject, preview text, and body content at runtime, then send the email to the selected user using your configured sender. This is the right tool when message content should adapt to the current user context instead of using fixed, pre-approved copy. The agent uses its prompt instructions and available user data to craft contextually relevant marketing content on every send. This makes AI Marketing Email particularly powerful for lifecycle messaging, personalized promotions, and campaigns where one-size-fits-all copy underperforms. You still control the sender configuration and delivery rules in the builder, so brand identity and send infrastructure remain consistent.

Configuration

Inputs

Prompt
string
Guidance for when and how the agent should use this tool.
Send to
string
required
Target org user ID. Can be selected in the builder or AI-defined during execution.
From
string
required
Sender configuration used for delivery.
Subject
string
required
Email subject. Typically AI-defined for personalization.
Preview (optional)
string
Preview text shown by inbox clients.
cc
string[]
Optional CC recipients.
bcc
string[]
Optional BCC recipients.

Outputs

status
enum
required
The status of the email send operation. Can be success, failure, or skipped.
to_id
string
required
The ID of the user that the email was sent to.
sender_config_id
string
required
The ID of the sender configuration used for the email.
email_id
string
The ID of the email that was sent (available on success).
create_email_options
object
The options used when creating the email, including the AI-generated subject, preview text, and body content (available on success).
create_email_response
object
The response from the email creation service (available on success).
code
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.
error_message
string
The message of the error that occurred (available on failure).

Use cases

Expansion Opportunity
Condition: User has high expansion potential based on usage patterns
Action: Generate benefit-led promotional copy tailored to user's current plan and activity
Outcome: User receives a personalized upgrade offer that speaks to their specific needs
Milestone Celebration
Condition: User completed a significant milestone event (e.g., first integration, 1000th API call)
Action: Generate contextual congratulations with a recommended next best action
Outcome: Timely lifecycle email reinforces engagement and guides the user forward
Personalized Re-Engagement
Condition: User has been inactive for 21+ days with previously high engagement
Action: Generate win-back email referencing the user's past activity and new features they missed
Outcome: Lapsed user receives relevant, personalized messaging that drives return visits
Segment-Specific Campaign
Condition: User matches a dynamic segment (e.g., healthcare vertical, enterprise tier)
Action: Generate industry- or tier-specific campaign content with relevant social proof
Outcome: Marketing email resonates with the recipient's context instead of using generic copy

Best practices

Prompt Quality
  • Write detailed prompt instructions that specify tone, length, CTA style, and any content constraints.
  • Include examples of good and bad output in the prompt to guide the agent’s content generation.
  • Reference specific user properties the agent should incorporate (e.g., plan name, company size, recent activity).
Content Guardrails
  • Specify prohibited claims, pricing language, or legal disclaimers that must be included or avoided.
  • Test generated content across multiple user profiles to verify the agent produces appropriate variations.
  • Monitor create_email_options output to audit what the agent actually sent in each email.
Testing and Iteration
  • Start with a narrow user segment to evaluate AI-generated copy quality before broadening the audience.
  • Compare open and click rates against builder-defined Marketing Email sends to measure personalization impact.
  • Iterate on prompt instructions based on real send outputs — refine constraints when the agent drifts from expected tone or format.