Skip to content

Remove Sparkpost email validation in favor of SES Auto Validation#8826

Merged
iHiD merged 2 commits intomainfrom
ihid/remove-sparkpost-email-validation
Mar 3, 2026
Merged

Remove Sparkpost email validation in favor of SES Auto Validation#8826
iHiD merged 2 commits intomainfrom
ihid/remove-sparkpost-email-validation

Conversation

@iHiD
Copy link
Member

@iHiD iHiD commented Mar 3, 2026

Summary

  • Removes the User::VerifyEmail command that called the Sparkpost Recipient Validation API to check email addresses on signup/email change
  • Removes the reverify_email! method and its after_update_commit trigger from the User model
  • Removes the email_status_invalid? gate from may_receive_emails? since SES Auto Validation handles suppression at the infrastructure level
  • Keeps the user_data.email_status column and enum (dormant), and the existing SPI bounce/complaint unsubscribe endpoint

Context

AWS SES now offers Auto Validation, which automatically validates every outbound email address before delivery at the infrastructure level. Once enabled via Terraform, invalid addresses are suppressed before delivery — no application-level pre-validation needed.

Terraform follow-up: Enable SES Auto Validation via PutAccountSuppressionAttributes with ValidationOptions.ConditionThreshold set to ENABLED and OverallConfidenceThreshold.Verdict set to MANAGED. The sparkpost_api_key secret can then be removed from infrastructure config.

Test plan

  • Verify bootstrap tests pass without VerifyEmail expectation
  • Verify user model tests pass without VerifyEmail/reverify expectations
  • Confirm no remaining references to VerifyEmail or Sparkpost in codebase
  • Enable SES Auto Validation in Terraform (separate PR)

🤖 Generated with Claude Code

iHiD and others added 2 commits March 3, 2026 14:27
SES Auto Validation now handles email address validation at the
infrastructure level before delivery, making the app-level Sparkpost
recipient validation redundant. This removes the VerifyEmail command,
its call sites (bootstrap + email change), and the email_status_invalid
gate from may_receive_emails?.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Keep blocking emails to addresses previously marked invalid by Sparkpost,
but allow sending to unverified addresses (which all new users will now
have since we no longer proactively validate).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@iHiD iHiD merged commit e3a6ab7 into main Mar 3, 2026
40 checks passed
@iHiD iHiD deleted the ihid/remove-sparkpost-email-validation branch March 3, 2026 16:06
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