Email Channels¶
Send Workbench uses email in two distinct ways: inbound emails drive the Smart Submissions intake workflow, and outbound emails deliver notifications, documents, and broker responses from the platform. This page covers the technical configuration of both channels.
For a functional overview of Smart Submissions (triage, Kanban board, SLA timers), see Smart Submissions.
Inbound email (Smart Submissions intake)¶
How it works¶
The Email In service (riskwire-email-in) is an Apache Camel-based gateway that polls a shared mailbox using IMAP and forwards incoming emails to the Email Service via an SQS queue.
The Email Service then passes the raw message content to the Text Analysis Service for AI-powered extraction and pre-population.
Mailbox setup¶
Each line of business that uses Smart Submissions needs a dedicated shared mailbox — the platform enforces a one-to-one relationship between a mailbox and a business class. The mailbox must be IMAP-accessible.
Mailbox credentials are configured in pde.dev.json (local) or the DynamoDB environment config (production):
{
"emailIn": {
"host": "imap.example.com",
"port": 993,
"username": "submissions@example.com",
"password": "${IMAP_PASSWORD}",
"ssl": true,
"folder": "INBOX",
"unseen": true,
"delete": false
}
}
| Field | Description |
|---|---|
host |
IMAP server hostname |
port |
IMAP port (typically 993 for SSL) |
username |
Shared mailbox address |
password |
Mailbox password — inject via environment variable |
ssl |
Must be true for production mailboxes |
folder |
Mailbox folder to poll (almost always INBOX) |
unseen |
When true, only processes unread messages |
delete |
When false, messages remain in the mailbox after processing (recommended) |
Warning
Never store mailbox passwords in plaintext in the config repository. Use environment variable injection or AWS Secrets Manager.
Polling interval¶
The polling frequency is controlled by the smartSubmission block in be_config.json (S3 business config):
Set this to balance responsiveness against API rate limits for your mail provider. 60 seconds is the default.
Email age filtering¶
To avoid processing a backlog of historical emails when first enabling Smart Submissions, maxEmailAgeInDays can be set in the same smartSubmission block. Confirm the exact key name against your platform version before relying on it.
Outbound email¶
How it works¶
The Email Out service (riskwire-email-out) sends emails from the platform to brokers, underwriters, and other recipients. Like Email In, it uses Apache Camel — but in reverse: it reads from an SQS queue and delivers to an SMTP server.
Outbound emails are triggered by pipeline actions — for example sending a quote summary to a broker, delivering a bound policy document, or notifying a coverholder of a declaration outcome.
SMTP configuration¶
SMTP credentials are set in pde.dev.json / DynamoDB:
{
"emailOut": {
"host": "smtp.example.com",
"port": 587,
"username": "noreply@example.com",
"password": "${SMTP_PASSWORD}",
"starttls": true,
"from": "Send Workbench <noreply@example.com>"
}
}
| Field | Description |
|---|---|
host |
SMTP server hostname |
port |
SMTP port (587 for STARTTLS, 465 for implicit TLS) |
username |
Sending account username |
password |
SMTP password — inject via environment variable |
starttls |
Enable STARTTLS encryption (recommended) |
from |
Display name and address used in the From header |
Triggering outbound email from a pipeline¶
Outbound emails are sent by including an email delivery step in a pipeline. Exact component type names and attribute keys vary between platform versions — confirm against your active core platform version. Illustrative shape:
{
"name": "Send Quote to Broker",
"componentType": "SEND_EMAIL",
"attributes": {
"to": "{{brokerEmail}}",
"subject": "Quote Reference {{riskReference}}",
"templatePath": "config/{client}/email-templates/quote-notification.html",
"attachDocument": true
}
}
The to field supports Handlebars-style placeholders referencing risk record fields. The templatePath points to an HTML email template in the config repository.
Email templates¶
HTML email templates live in the client config repository under:
Templates support the same Handlebars syntax used for document generation. See Handlebars Reference for the available helpers.
Email reply handling¶
When Smart Submissions is enabled, brokers can reply to automated emails and have those replies attached to the corresponding risk record. The reply-matching behaviour is controlled by the smartSubmission block in be_config.json (S3 business config). Key names for the reply-handling flags vary by platform version — confirm with your delivery lead before relying on specific names such as emailReplyEnabled or replyMatchingField.
Attachments¶
Outbound emails can carry document attachments generated by the document generation pipeline. Set attachDocument: true in the pipeline component and ensure the preceding pipeline step has generated the document and stored its reference in the pipeline context.
Inbound email attachments (e.g. a submission slip or schedule sent by a broker) are extracted by the Text Analysis Service and made available in the Smart Submissions interface for manual mapping or AI extraction.
Local development¶
Both Email In and Email Out require a reachable mail server. For local development:
- Email In: Point the IMAP config at a test mailbox (e.g. a dedicated Gmail account with IMAP enabled, or a local Mailhog instance)
- Email Out: Use Mailhog or a similar local SMTP testing tool that captures outbound emails without actually delivering them
Mailhog is available as a Docker image and can be added to your local docker-compose.yml:
mailhog:
image: mailhog/mailhog
ports:
- "1025:1025" # SMTP
- "8025:8025" # Web UI to inspect captured emails
Configure Email Out to use localhost:1025 and visit http://localhost:8025 to inspect outbound messages.
See also¶
- Smart Submissions — functional overview of the Smart Submissions workflow
- Pipelines — for triggering email from pipeline components
- Document Generation Overview — for attaching generated documents to outbound emails
- SFTP — for file-based delivery as an alternative to email