IronFlowDocs

send_email

Send an email via the Resend API or SMTP.

Parameters

Common Parameters

providerstringdefault "resend"
Email provider: "resend" or "smtp".
tostring or arrayrequired
Recipient email address(es). Supports ${ctx.key} interpolation.
subjectstringrequired
Email subject line. Supports interpolation.
fromstringdefault env SENDER_EMAIL or "[email protected]"
Sender email address.
htmlstring
HTML body content. Supports interpolation.
textstring
Plain text body content. Supports interpolation.
ccstring or array
CC recipient(s).
bccstring or array
BCC recipient(s).
reply_tostring or array
Reply-To address(es).
timeoutnumberdefault 30
Request timeout in seconds.
output_keystringdefault "email"
Prefix for context output keys.

Resend-specific Parameters

ParameterTypeRequiredDefaultDescription
api_keystringnoenv RESEND_API_KEYResend API key.

SMTP-specific Parameters

ParameterTypeRequiredDefaultDescription
smtp_serverstringnoenv SMTP_SERVERSMTP server hostname.
smtp_portnumbernoenv SMTP_PORT or provider defaultSMTP port (587 for STARTTLS, 465 for TLS, 25 for none).
smtp_usernamestringnoenv SMTP_USERNAMESMTP authentication username.
smtp_passwordstringnoenv SMTP_PASSWORDSMTP authentication password.
smtp_tlsstringno"starttls"TLS mode: "starttls" (default), "tls" (implicit), or "none".

Context Output

  • {output_key}_status — HTTP status code (Resend) or SMTP response code.
  • {output_key}_data — Response body (Resend JSON) or SMTP response details.
  • {output_key}_successtrue on success.

Environment Variables

VariableDescription
RESEND_API_KEYResend API key (fallback when api_key is not in config)
SENDER_EMAILDefault sender address (fallback when from is not in config)
SMTP_SERVERSMTP server hostname
SMTP_PORTSMTP server port
SMTP_USERNAMESMTP authentication username
SMTP_PASSWORDSMTP authentication password

Examples

Resend API

local flow = Flow.new("send_email_resend")

flow:step("send", nodes.send_email({
    to = env("SENDER_EMAIL"),
    subject = "Welcome to IronFlow!",
    html = "<h1>Welcome!</h1><p>Your workflow engine is ready.</p>",
    text = "Welcome! Your workflow engine is ready."
}))

flow:step("log", nodes.log({
    message = "Email result: success=${ctx.email_success}, data=${ctx.email_data}"
})):depends_on("send")

return flow

SMTP

local flow = Flow.new("send_email_smtp")

flow:step("send", nodes.send_email({
    provider = "smtp",
    to = env("SENDER_EMAIL"),
    subject = "IronFlow SMTP Test",
    html = "<h1>Hello!</h1><p>Sent via SMTP.</p>",
    text = "Hello! Sent via SMTP."
}))

return flow

Multiple recipients

flow:step("notify_team", nodes.send_email({
    to = { "[email protected]", "[email protected]" },
    from = "[email protected]",
    subject = "Deploy complete: ${ctx.version}",
    html = "<p>Version <b>${ctx.version}</b> deployed.</p>",
    cc = "[email protected]",
    output_key = "deploy_email"
}))

IronFlow documentation

Find the next step

Type a keyword to search the documentation.

to move · Enter to open · Esc to close