Skip to content

Replace Postmark with AWS SES for email sending and begin sending confirmations for mid/end-of-quarter feedback - #147

Draft
xalbd wants to merge 1 commit into
mainfrom
aws-ses-email-migration
Draft

Replace Postmark with AWS SES for email sending and begin sending confirmations for mid/end-of-quarter feedback#147
xalbd wants to merge 1 commit into
mainfrom
aws-ses-email-migration

Conversation

@xalbd

@xalbd xalbd commented Jul 29, 2026

Copy link
Copy Markdown
Member

Fixes #143 and also fixes #8.

Do not merge yet. This PR has not undergone human review.

Move all outbound mail to SES, called as a signed REST request via aws4fetch rather than @aws-sdk/client-sesv2, which is far too large for a Worker bundle.

Emails are authored once as a block list and rendered twice, to HTML and to plain text, so the text/plain alternative can't drift from the HTML. HTML is built from @react-email/components for its email-client workarounds (Outlook conditional tables, MSO button padding, preheader whitespace trick) but rendered with react-dom/server rather than @react-email/render — that package pulls in html-to-text and js-beautify for features this app doesn't use, at 132 KB gzipped versus 4.8 KB for the whole module as written.

Also send a confirmation email for student mid-/end-of-quarter feedback submissions, calling out whether the submitter included a UID, since that's the only way a submission can be credited. The send happens in ctx.waitUntil so a slow SES call can't fail an accepted submission.

The commented-out Postmark batch in process-withdraws is rewritten against the new API and its template ported, so uncommenting it works.

Move all outbound mail to SES, called as a signed REST request via
aws4fetch rather than @aws-sdk/client-sesv2, which is far too large for
a Worker bundle.

Emails are authored once as a block list and rendered twice, to HTML and
to plain text, so the text/plain alternative can't drift from the HTML.
HTML is built from @react-email/components for its email-client
workarounds (Outlook conditional tables, MSO button padding, preheader
whitespace trick) but rendered with react-dom/server rather than
@react-email/render — that package pulls in html-to-text and js-beautify
for features this app doesn't use, at 132 KB gzipped versus 4.8 KB for
the whole module as written.

Also send a confirmation email for student mid-/end-of-quarter feedback
submissions, calling out whether the submitter included a UID, since
that's the only way a submission can be credited. The send happens in
ctx.waitUntil so a slow SES call can't fail an accepted submission.

The commented-out Postmark batch in process-withdraws is rewritten
against the new API and its template ported, so uncommenting it works.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
❌ Deployment failed
View logs
laprogram 75088b1 Jul 29 2026, 11:46 PM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Move Postmark to AWS Mid-quarter/end-quarter feedback should email you with confirmation

1 participant