Skip to main content
Production-grade email delivery using AWS Simple Email Service (SES) with bounce handling, suppression management, and observability.

Architecture

Truthlocks uses AWS SES for all transactional emails. The integration includes:
  • SES Provider: Direct integration with SES v2 API for sending emails
  • SNS Webhooks: Real-time bounce/complaint notifications via SNS topics
  • Suppression List: Automatic suppression of hard bounces and complaints
  • Environment Gating: Log-only mode for development, SES for production

AWS SES setup

1. Verify domain

Verify your sending domain in SES console:

2. Configure DNS records

Add the following records to your domain DNS:

3. Request production access

New SES accounts are in sandbox mode. Request production access in the SES console to send emails to unverified addresses.

Environment variables

In ENV=production, the service will fail to start if SES_REGION and SES_FROM are not configured.

Bounce & complaint handling

SES notifications are received via an SNS webhook at /v1/notifications/ses-events.

Event types

  • Bounce (Permanent): Hard bounce — email suppressed automatically
  • Bounce (Transient): Soft bounce — logged but not suppressed
  • Complaint: User marked as spam — email suppressed automatically
  • Delivery: Successful delivery — logged for observability

Suppression list management

Suppressed emails are stored in the email_suppressions table and will not receive future emails. The API returns EMAIL_SUPPRESSED error code.

Email sender management

You can manage sender identities and custom SMTP configuration from Settings > Email in the tenant console. This is useful when your organization requires emails to originate from your own domain or mail infrastructure.

Adding a sender

1

Open email settings

Navigate to Settings > Email in the tenant console.
2

Add a new sender

Click Add Sender and provide:
  • From email (required) — the address emails are sent from (e.g., noreply@agency.gov)
  • From name — display name shown to recipients
  • Reply-to — where replies are directed
3

Verify the sender

New senders start in PENDING status. Click Verify to trigger SES identity verification. Once SES confirms the domain, the sender moves to VERIFIED status.

Configuring custom SMTP

Enterprise and government tenants can bypass SES entirely by attaching a custom SMTP server to a verified sender. Once configured, all emails for that tenant route through your SMTP server.
1

Select a verified sender

In Settings > Email, choose a sender with VERIFIED or ACTIVE status.
2

Configure SMTP

Click Configure SMTP and provide:
  • SMTP host — your mail server hostname
  • SMTP port — typically 587 (STARTTLS) or 465 (TLS)
  • Username and Password — SMTP authentication credentials
  • Use TLS — enable for encrypted connections (recommended)
3

Send a test email

After saving, send a test email to confirm delivery. The sender status changes to ACTIVE once the first email is sent successfully.
Custom SMTP is particularly useful for government tenants that require emails to originate from their own mail infrastructure. See the B2G Procurement Pack for the full enterprise onboarding email flow.

Email template reference

Truthlocks uses named templates for all transactional emails. Each template supports placeholder substitution and is routed through either AWS SES or a tenant-configured custom SMTP server.

Onboarding & invitations

Account & security

Issuer lifecycle

Enterprise onboarding sequence

Government and institutional tenants receive a sequence of lifecycle emails as they progress through onboarding. These are sent automatically at each stage.
The onboarding sequence is fully automated. As a platform admin, you trigger it by creating a tenant with the GOVERNMENT type or by qualifying a lead in the leads pipeline.

Other notifications

Government tenants (GOVERNMENT type) automatically receive the enterprise-onboarding-invite template instead of the standard issuer welcome. See the B2G Procurement Pack for details on the enterprise onboarding flow.

Troubleshooting

Email not received

  1. Check logs for email_sent or email_send_failed events
  2. Verify the recipient email is not in email_suppressions
  3. Check SES console for sending quota and reputation
  4. Verify DKIM/SPF records are correctly configured

Common error codes

Observability

All email operations are logged with structured fields:
Key log events to monitor: