Corporate Email Campaign
Send or preview personalized email batches by employee groups using server-managed mail transport
The Corporate Email Campaign (email_campaign) integration enables workflows and Web Chat deployments to send personalized email batches across employee groups using server-configured mail transport—without exposing API keys or SMTP credentials inside workflow blocks.
Key capabilities include:
- Server-Managed Transport: Uses server-side
RESEND_API_KEYandCAMPAIGN_FROM_EMAILso workflow authors never handle secrets. - Dry-Run Preview Mode: Validates email syntax, recipient allowlist rules, and group variable rendering without sending live emails or consuming daily quota.
- Recipient Allowlist Protection: Filters every recipient against
CAMPAIGN_TEST_RECIPIENT_ALLOWLISTbefore batch submission so invalid or unauthorized addresses are isolated inrejectedwithout failing valid recipients. - Group Template Deduplication: Define subject and HTML/text templates once per employee group via
groupTemplateswhile passing lightweight recipient variables inmessages. - Ready-Made Web Chat Report: Outputs
summaryMarkdownwith a per-group table and human-readableCMP-YYYYMMDD-XXXXcampaign code ready for Deploy → Chat.
Usage Instructions
Pass a JSON array of up to 100 recipient objects in messages (directly or from a Function / Agent block). Keep dryRun enabled (true) while testing group templates, and wire summaryMarkdown to your Web Chat output.
Tools
email_campaign_send
Send or preview up to 100 personalized emails by employee groups using server-configured mail transport.
Input
| Parameter | Type | Required | Description |
|---|---|---|---|
campaignName | string | No | Optional human-readable campaign title for logs and chat reports |
messages | json | Yes | JSON array of recipient items: [{ to, subject?, body?, contentType?, group?, variables? }] |
groupTemplates | json | No | Optional JSON map of templates per group: { "HR": { "subject": "...", "body": "..." } } |
defaultSubject | string | No | Fallback email subject template (supports {{variable}} placeholders) |
defaultBody | string | No | Fallback email body template (supports {{variable}} placeholders) |
contentType | string | No | Default content format for email body (html or text) |
replyTo | string | No | Optional Reply-To email address |
dryRun | boolean | No | When true, validates recipients and builds group report without sending real emails or spending quota |
idempotencyKey | string | No | Optional idempotency key to prevent duplicate batch sends on retry |
Output
| Parameter | Type | Description |
|---|---|---|
success | boolean | Whether the campaign batch completed successfully |
campaignCode | string | Short human-readable campaign identifier (e.g. CMP-20261119-7K4P) |
campaignName | string | Campaign title if provided |
dryRun | boolean | Whether the run executed in preview mode without sending real emails |
from | string | Server-configured sender email address |
totalRequested | number | Total recipient records received by the block |
acceptedCount | number | Number of recipient records that passed validation and allowlist checks |
sentCount | number | Number of emails sent (or verified in dry-run mode) |
rejectedCount | number | Number of recipient records rejected by validation or allowlist |
groupBreakdown | json | Per-group counters { accepted, sent, rejected } |
rejected | array | Rejected recipients with reasons |
messageIds | array | Provider message IDs returned for live sends |
summaryMarkdown | string | Ready-to-render Markdown summary report for Web Chat |