WAIT: Give every seeded notification an email body#1877
Open
maebeale wants to merge 1 commit into
Open
Conversation
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>
maebeale
commented
Jun 22, 2026
| 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? |
Collaborator
Author
There was a problem hiding this comment.
🤖 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🤖 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_subjectbut neveremail_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
contact_us_sampleswith sender names + a message so bodies read like genuine submissions.email_body_*on re-run for records that were seeded before this change (thefind_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
NotificationMailerJobfills 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.