Send Email

Action ID: send_email

Description

Send an email to specified recipients with customizable subject, body, and optional HTML content.

Input Parameters

Name
Type
Required
Default
Description

recipient_emails

array

-

List email addresses of the recipients.

cc_emails

array

-

[]

List email addresses of the CC recipients.

bcc_emails

array

-

[]

List email addresses of the BCC recipients.

subject

string

-

Subject of the email.

body

string

-

-

Body of the email. This field is required if body_html is not provided.

body_html

string

-

-

The body of the email in HTML format. This field is required if body is not provided.

View JSON Schema
{
  "description": "Input of the Send Email node.",
  "properties": {
    "recipient_emails": {
      "title": "Recipient Emails",
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "List email addresses of the recipients."
    },
    "cc_emails": {
      "default": [],
      "title": "CC Emails",
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "List email addresses of the CC recipients."
    },
    "bcc_emails": {
      "default": [],
      "title": "BCC Emails",
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "List email addresses of the BCC recipients."
    },
    "subject": {
      "title": "Subject",
      "type": "string",
      "description": "Subject of the email."
    },
    "body": {
      "default": null,
      "title": "Body",
      "type": "string",
      "description": "Body of the email. This field is required if body_html is not provided."
    },
    "body_html": {
      "default": null,
      "title": "Body html",
      "type": "string",
      "description": "The body of the email in HTML format. This field is required if body is not provided."
    }
  },
  "required": [
    "recipient_emails",
    "subject"
  ],
  "title": "SendEmailNodeInput",
  "type": "object"
}

Output Parameters

Name
Type
Description

message

string

Status notification message

email_id

string

The ID of the email sent

View JSON Schema
{
  "description": "Output of the Send Email node.",
  "properties": {
    "message": {
      "title": "Message",
      "type": "string",
      "description": "Status notification message"
    },
    "email_id": {
      "title": "Email ID",
      "type": "string",
      "description": "The ID of the email sent."
    }
  },
  "required": [
    "message",
    "email_id"
  ],
  "title": "SendEmailNodeOutput",
  "type": "object"
}

How It Works

This node constructs an email message using the parameters you provide, then sends it through the email service. The email includes the specified recipients (To, CC, BCC), subject line, and body content (either plain text or HTML). The service returns a confirmation with the email ID and a status message indicating whether the send was successful.

Usage Examples

Example 1: Simple Text Email

Input:

recipient_emails: ["[email protected]"]
subject: "Welcome to AgenticFlow"
body: "Hi John, welcome to our service. We're excited to have you on board!"

Output:

message: "Email sent successfully"
email_id: "msg_1234567890"

Example 2: HTML Email with Multiple Recipients

Input:

recipient_emails: ["[email protected]", "[email protected]"]
cc_emails: ["[email protected]"]
subject: "Monthly Report - January 2024"
body_html: "<h1>Monthly Report</h1><p>Here is your monthly summary:</p><ul><li>Revenue: $10,000</li><li>Users: 500</li></ul>"

Output:

message: "Email sent successfully"
email_id: "msg_1234567891"

Example 3: Email with BCC (Confidential Distribution)

Input:

recipient_emails: ["[email protected]"]
bcc_emails: ["[email protected]", "[email protected]"]
subject: "Account Confirmation"
body: "Your account has been successfully created. You can now log in."

Output:

message: "Email sent successfully"
email_id: "msg_1234567892"

Common Use Cases

  • Notifications: Send transactional emails like order confirmations, password resets, and account notifications

  • Marketing Campaigns: Distribute marketing messages and newsletters to multiple recipients

  • Reports: Send periodic reports, summaries, and data updates via email

  • Alerts: Notify users of important events, errors, or threshold breaches

  • Confirmations: Send confirmation emails for user actions like registration or form submissions

  • Multi-recipient Distribution: Send the same message to groups of users with CC and BCC functionality

Error Handling

Error Type
Cause
Solution

Invalid Email Address

Recipient email format is invalid

Verify all email addresses follow the format: [email protected]

Missing Subject

Subject line is empty or not provided

Provide a non-empty subject for the email

Empty Body

Both body and body_html are empty or null

Provide either plain text body or HTML body content

Recipient List Empty

recipient_emails array is empty

Add at least one recipient email address

Service Unavailable

Email service is temporarily down

Retry the operation after a delay or check service status

Rate Limit

Too many emails sent in a short period

Implement delays between email sends or check rate limits

Notes

  • Email Content: You must provide either body (plain text) or body_html (HTML formatted). You cannot leave both empty.

  • Multiple Recipients: Provide email addresses as an array. You can have multiple recipients, CC, and BCC recipients.

  • HTML Formatting: Use body_html to create visually rich emails with formatting, images, and styling.

  • Email ID: The output includes an email_id that can be used for tracking or reference purposes.

  • Plain Text Fallback: If providing HTML content, consider also providing plain text in body for email clients that don't support HTML.

  • Deliverability: Ensure your sender domain is properly configured and authenticated to improve email deliverability.

Last updated

Was this helpful?