Skip to content
SendOps

Building an Onboarding Email Engine on AWS SES: A Practical DIY Guide

A practical DIY guide to an onboarding email engine on AWS SES: scheduling, eligibility checks, retries, feedback loops, metrics and the real cost.

Kash Sajadi 9 min read

Amazon Simple Email Service gives you a cost-effective foundation for application email. Your application decides what to send, and SES handles delivery.

An onboarding sequence adds another layer of responsibility: deciding who should receive each message, when it should arrive, and whether it is still relevant.

You can build that layer yourself. For a straightforward sequence, the starting architecture can be modest: a database, a background worker, SES, and a pipeline for delivery feedback.

The longer-term commitment is operating it. Someone must investigate missing messages, handle retries safely, update journeys, respect changing preferences, and make the results understandable to the rest of the team.

This guide walks through a practical DIY approach, then shows where SendOps can take over that work.

1. Define the journey before choosing the infrastructure

Consider a simple onboarding journey for a collaboration app:

  1. A customer signs up and receives a welcome email.
  2. Three days later, check whether they have invited a teammate.
  3. If they have, finish the journey.
  4. Otherwise, send a team-invite reminder and finish.

Before implementing it, decide:

  • Does the journey belong to a person or a workspace?
  • Can someone enter more than once?
  • What happens if they unsubscribe during the wait?
  • What happens if the reminder is delayed by an outage?
  • Which version should an enrolled customer follow after you edit the journey?

For this example, assume one enrollment per customer, a fixed workflow version, and a reminder that expires after day seven. The team-invite milestone should come from your application’s authoritative workspace state.

These decisions become the rules your worker enforces.

2. Start with persistent scheduling

For a short sequence, you can store the next action in your existing database and have a worker claim due work.

An enrollment record might contain:

id
customer_id
workflow_key
workflow_revision
current_step
next_run_at
expires_at
status
lease_until

Add a uniqueness constraint that matches your enrollment policy—for example, one enrollment per customer and workflow.

Index the fields used to find due work. Claim jobs atomically, using a database locking pattern or your job framework’s equivalent, so two workers cannot process the same enrollment simultaneously. A lease allows another worker to recover a job after a crash.

When account creation starts the journey, consider writing an enrollment request to an outbox in the same transaction as the new account. A background process can then deliver it reliably, closing the gap between “the account exists” and “the onboarding job was scheduled.”

For more complicated journeys, a durable workflow engine may be a better fit. AWS Step Functions Standard supports waits long enough for multi-day onboarding; Express workflows have much shorter duration limits. Choose the execution model deliberately. AWS Wait state documentation

You do not need a workflow engine simply because an email goes out three days later. You need a reliable record of what should happen next.

3. Recheck eligibility immediately before sending

A customer’s state can change while a message waits.

The reminder should therefore evaluate current state when it is about to send:

process reminder:
    load current customer and workspace state

    if journey expired:
        record "skipped: expired"
    else if teammate already invited:
        record "completed: goal reached"
    else if recipient is suppressed:
        record "skipped: suppressed"
    else if recipient is not eligible for this message:
        record "skipped: preferences"
    else:
        attempt delivery through SES
        record the outcome

This is illustrative control flow, rather than a complete worker. Persistence, concurrency, and failure recovery still need implementation.

Keep consent, topic preferences, and suppression distinct. A customer may opt out of onboarding tips while still needing account-security messages. An address suppressed after a permanent delivery failure presents a different problem.

Classify messages according to their purpose and applicable rules. Under CAN-SPAM, for example, the primary purpose helps determine whether a message is commercial or transactional. Calling a sequence “onboarding” does not settle that question. FTC guidance

For marketing messages, implement a visible unsubscribe link and appropriate one-click support. RFC 8058 requires more than headers: the HTTPS endpoint must process the unsubscribe POST without login or further confirmation, and a valid DKIM signature must cover the unsubscribe headers. A routine GET should not trigger the one-click action, because automated scanners may fetch links. RFC 8058

Make preference changes durable promptly and check them as close to submission as practical. Once SES has accepted a message, a later preference change cannot recall it.

4. Treat retries as a delivery-design problem

Background jobs fail. Networks time out. SES can throttle requests.

Maintain a send ledger separate from the enrollment record:

enrollment_id
step_key
status
attempt_count
last_attempt_at
ses_message_id
last_error

Use a unique constraint on (enrollment_id, step_key) to represent one logical message. Coordinate workers around that record, and preserve attempt history.

This prevents many application-level duplicates, but it does not make delivery exactly once.

Suppose SES accepts a message, but your worker loses the response before saving the message ID. The database and SES now disagree about what the worker knows. Retrying may send a duplicate; assuming success may leave a message unsent.

Define an explicit policy for uncertain outcomes. Record them separately, use available feedback to reconcile them, and decide when investigation is preferable to an automatic retry. A unique database row cannot make a database transaction atomic with an external email API call.

For ordinary retryable failures, use bounded exponential backoff with jitter. Coordinate sending rates across workers, respect your account’s regional quotas, and move exhausted attempts into a queue or state someone can inspect. AWS sending limits

Apply the reminder’s expiry rule during recovery too. A successfully retried onboarding email may still be useless if it arrives weeks late.

5. Build the delivery feedback loop

An accepted API request is only the beginning of a message’s lifecycle.

A practical feedback pipeline is:

SES configuration set
    → SNS
    → SQS
    → feedback worker
    → message history and suppression state

Configure the relevant event types, attach the configuration set to your sends, and include identifiers that let you connect feedback to the workflow and step. For personalized onboarding, sending to one recipient per operation simplifies that relationship.

Your feedback worker should:

  • Record delivery and failure events against the message.
  • Update suppression state for permanent bounces and actionable complaints.
  • Deduplicate repeated event deliveries.
  • Preserve enough information to investigate processing failures.
  • Retry failed processing and expose exhausted work.

Use the schema for the event source you actually configured. SES event publishing uses eventType; the separate notification format uses notificationType. Rendering failures are operational failures, rather than engagement events. AWS event schema

Configure SES suppression behavior as well as your application’s checks. Keeping addresses out of an onboarding audience and preventing delivery to a suppressed address are separate responsibilities.

Monitor the feedback pipeline itself. A healthy sending worker with a broken feedback consumer can continue operating with stale information.

6. Measure product progress as well as email engagement

For this journey, the useful outcome is a teammate invitation.

Store enough information to connect:

  • The customer’s enrollment and workflow revision.
  • Each logical message and its delivery outcome.
  • The team-invite milestone and its timestamp.

Define metrics before building the dashboard:

MetricSuggested definition
Accepted messagesDistinct message IDs accepted by SES
Delivered messagesDistinct messages with a delivery event
Unique clicked messagesDistinct messages with at least one click
Workflow completionEligible enrollments that reach the defined milestone
Skipped messagesSteps skipped, grouped by recorded reason

Count distinct messages or recipients according to the question being answered. Counting event rows as “unique clicks” will inflate results when one person clicks repeatedly.

Open and click tracking also have measurement limits. Recipient privacy settings and email-client behavior can distort the signals, so use them as supporting evidence rather than definitive measures of human attention. AWS tracking FAQs

Define a conversion window—for example, inviting a teammate within seven days of enrollment. Report whether the cohort has had enough time to complete that window.

A customer converting after an email does not establish that the email caused the conversion. If you need to estimate incremental impact, use a randomized holdout and compare equivalent cohorts.

7. Add infrastructure when the workload justifies it

An indexed relational database can be a reasonable starting point for enrollment state, send records, and modest reporting.

Keep large analytical scans away from latency-sensitive application queries. Establish retention rules, monitor query performance, and consider summary tables, replicas, or a separate analytics store as requirements grow.

ClickHouse or Redshift may eventually be useful. The decision should follow measured workload and reporting needs.

The same principle applies to queues and orchestration: use the simplest architecture that meets your reliability requirements, then expand it with evidence.

Before launch, test the failures that matter:

  • Two workers claim the same step.
  • A customer unsubscribes during a wait.
  • A teammate is invited just before the reminder.
  • SES throttles a request.
  • A worker crashes around message submission.
  • Feedback arrives twice or out of order.
  • A workflow changes while customers are enrolled.

Keep a readable history of those decisions. Support should be able to answer “Why didn’t this customer receive the reminder?” without reconstructing several days of logs.

What does DIY actually cost?

Assume 100,000 customers enter a five-message journey. If every message is sent, that is 500,000 emails.

At SES à la carte outbound pricing of $0.10 per 1,000 emails, the base sending charge would be $50. Other SES plans have different rates, and data, optional features, and supporting services can add charges. Check the pricing that applies to your account. AWS SES pricing

The surrounding infrastructure may also be inexpensive, particularly if your application already has workers, queues, and monitoring.

A useful comparison includes more than that monthly bill:

CostWhat to include
Initial implementationScheduling, preferences, retries, feedback, reporting
Routine operationAlerts, investigations, recovery, dependency updates
Campaign changesNew branches, templates, enrollment rules, migrations
Team toolingPreviews, permissions, history, reporting, support access

Estimate those costs using your own requirements and engineering rates. A single stable sequence may be cheap to own. A growing lifecycle program can become a substantial internal product.

Running the same journey with SendOps

SendOps provides the management and workflow layer around your AWS SES account. Email continues to send through your SES account, with AWS sending charges still applying.

The journey’s logic can be expressed in SendFlow:

workflow "Team onboarding" v1 {
  enter on activity.signup
  enroll forward
  reentry once

  exit "team invited" when count(activity.team_invited) > 0

  send "welcome" via topic "onboarding"
  wait 3d
  send "invite-team-reminder" via topic "onboarding"
}

This example assumes the templates and onboarding topic exist, the sender and channel are configured, and your application records the signup and team-invite activities against the appropriate contact.

The named exit declares the goal once, allowing the engine to evaluate it as the journey progresses. The v1 marker identifies the SendFlow language version. SendFlow documentation

Your application still owns the meaning and accuracy of those activities. If it never reports a teammate invitation, the workflow cannot know it happened.

Around that journey, SendOps brings together audience definitions, template management, message reporting, deliverability visibility, and version history. Those are capabilities a DIY implementation otherwise needs to provide through code, dashboards, and operating procedures. SendOps documentation

The benefit is having a shared system for managing email as the number of journeys and people working on them grows.

When to build—and when to use SendOps

DIY is a reasonable choice when the journey is simple, your existing infrastructure covers most requirements, and your team is comfortable owning delivery operations. Specialized requirements can also justify a custom system.

SendOps becomes compelling when lifecycle email matters to the business and the surrounding work keeps expanding: more audiences, more journeys, more campaign changes, and more questions about what happened to individual messages.

You still own your product events, message content, consent decisions, AWS account, and customer experience. SendOps reduces the amount of email-management software your team needs to build and operate.

Build a DIY version if maintaining that system is a worthwhile investment for your team. If you want SES economics while spending more of your engineering time on your own product, explore SendOps.