Skip to content

WAIT: Give every seeded notification an email body#1877

Open
maebeale wants to merge 1 commit into
mainfrom
maebeale/email-seeds-add-body
Open

WAIT: Give every seeded notification an email body#1877
maebeale wants to merge 1 commit into
mainfrom
maebeale/email-seeds-add-body

Conversation

@maebeale

Copy link
Copy Markdown
Collaborator

🤖 PR, suggested 👤 review level: 👀 Skim — dev-seed data only: adds email bodies to seeded notifications, no app/logic changes

Why

Seeded contact-us and FYI notifications set an email_subject but never email_body_html/email_body_text, so opening one in the admin Email Preview pane (notifications/show) rendered the "No email body captured." placeholder. This is also what made the user suspect seeded emails had no body.

What

  • Render realistic HTML + plain-text bodies for every seeded notification (contact-us confirmation, contact-us FYI, and the registration/idea/workshop-log FYIs), modeled on the real mailer templates.
  • Enrich contact_us_samples with sender names + a message so bodies read like genuine submissions.
  • Backfill email_body_* on re-run for records that were seeded before this change (the find_or_create_by! block only fires on create).

Not in scope

The "Pending, no subject" registration confirmation rows in the screenshot are not seeded — they come from the real registration flow, where NotificationMailerJob fills in subject/body asynchronously. On staging they stay pending if the job queue worker isn't running or the job is failing. That's a separate ops issue, called out so it isn't lost.

Seeded contact-us and FYI notifications set a subject but never
email_body_html/text, so the admin "Email Preview" pane rendered
"No email body captured." Render realistic HTML + text bodies for
each, and backfill any pre-existing body-less seed records on re-run.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
n.email_body_text = confirmation_text
end
# Backfill bodies on records seeded before email_body_* was added here
confirmation.update!(email_body_html: confirmation_html, email_body_text: confirmation_text) if confirmation.email_body_html.blank?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 From Claude: The block in find_or_create_by! only runs on create, so records seeded before bodies were added here would stay body-less on re-run. This backfill makes re-seeding idempotently repair them.

@maebeale maebeale marked this pull request as ready for review June 23, 2026 00:47
@maebeale maebeale changed the title Give every seeded notification an email body WAIT: Give every seeded notification an email body Jun 23, 2026
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.

1 participant