This project was built to understand how Amazon SES works as a verified sending domain with multiple
named identities. The domain sharathonline.com is verified once in SES, and three distinct
"personas" send from it: happy-morning@sharathonline.com,
happy-evening@sharathonline.com, and story-time@sharathonline.com.
Three independent AWS Lambda functions generate content and send email through SES, each triggered on its own
weekday schedule via Amazon EventBridge — with no servers to manage.
Architecture Diagram
Fig. 1 — Scheduled, event-driven email pipeline across three independent Lambda functions sharing one verified SES domain
Lambda Functions
Function
Sender Identity
Content Source
Schedule (EventBridge)
Notes
morning-mailer.py
happy-morning@sharathonline.com
quotes.txt (random pick)
Weekdays, 10:00 AM IST
Supports multiple recipients (comma/semicolon separated) from one env var
evening-mailer.py
happy-evening@sharathonline.com
Accomplishment-themed quotes file
Weekdays, 6:30 PM IST
Same random-quote pattern, different tone/content set
story-mailer.py
story-time@sharathonline.com
External API: shortstories-api.onrender.com
Weekdays, 10:00 AM IST
Subject line built dynamically from the story's moral; handles HTTPError/URLError
How It Works
Amazon EventBridge Scheduler rules trigger each Lambda on a cron schedule — no polling, no always-on compute.
morning-mailer and evening-mailer read a bundled quotes file, pick one at random with random.choice(), and email it as plain text.
story-mailer calls the public Story API over HTTPS, extracts the story and its moral, and uses the moral as the email subject.
All three functions read the recipient list from a RECIPIENT_EMAIL Lambda environment variable and support multiple comma/semicolon-separated addresses.
Each function sends via boto3's SES send_email API using its own verified sender identity under the shared domain.
Execution logs and errors are captured automatically in Amazon CloudWatch Logs for observability.
Key Learnings
How a single verified SES domain can back multiple sender addresses/identities without re-verifying each one.
Designing small, single-purpose Lambda functions decoupled from their trigger schedule via EventBridge.
Handling external API failures gracefully (HTTPError vs. URLError) in a serverless function.
Passing configuration (recipients) through environment variables instead of hardcoding.
Sample Email Outputs
morning-mailer.py happy-morning@sharathonline.com
evening-mailer.py happy-evening@sharathonline.com
story-mailer.py story-time@sharathonline.com
Fig. 2 — Actual delivered emails from each scheduled Lambda function