Skip to content

fix: clarify SES no-tracking config set failures#377

Open
S1lander wants to merge 1 commit into
useplunk:nextfrom
S1lander:fix-configuration-set-error
Open

fix: clarify SES no-tracking config set failures#377
S1lander wants to merge 1 commit into
useplunk:nextfrom
S1lander:fix-configuration-set-error

Conversation

@S1lander
Copy link
Copy Markdown

Description

This PR improves server-side error reporting when AWS SES rejects an email because the selected "no-tracking" configuration set does not exist. I ran into this while trying to send a preview email for a campaign, which didn't work and only returned a minimal error message.

Preview/test campaign emails disable tracking, which causes the API to use SES_CONFIGURATION_SET_NO_TRACKING when the tracking toggle is enabled. If that no-tracking configuration set is missing or misconfigured in AWS SES, the previous error was insufficient from the server logs.

This change wraps the SES sendRawEmail call with contextual error handling and includes:

  • the SES configuration set name used for the send
  • a specific hint for preview/test emails using SES_CONFIGURATION_SET_NO_TRACKING
  • the original SES error message
  • the original error as the cause

Type of Change

  • feat: New feature (MINOR version bump)
  • fix: Bug fix (PATCH version bump)
  • feat!: Breaking change - new feature (MAJOR version bump)
  • fix!: Breaking change - bug fix (MAJOR version bump)
  • docs: Documentation update (no version bump)
  • chore: Maintenance/dependencies (no version bump)
  • refactor: Code refactoring (no version bump)
  • test: Adding tests (no version bump)
  • perf: Performance improvement (PATCH version bump)

Testing

Tested manually in a local Docker setup by invoking sendRawEmail inside the API container with:

  • tracking: false
  • SES_CONFIGURATION_SET_NO_TRACKING=plunk-no-tracking-configuration-set
  • valid AWS SES credentials

Confirmed the server-side error now includes:

Failed to send email via SES using configuration set "plunk-no-tracking-configuration-set". If this was a preview/test email, verify SES_CONFIGURATION_SET_NO_TRACKING exists in AWS SES. Original error: Configuration set <plunk-no-tracking-configuration-set> does not exist.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Improves error reporting when AWS SES rejects an email send by wrapping sendRawEmail with a try/catch that adds the configuration set name, a hint about SES_CONFIGURATION_SET_NO_TRACKING for preview/test emails, and preserves the original error as cause.

Changes:

  • Wrap the ses.sendRawEmail call in a try/catch in SESService.ts.
  • Throw an enriched Error containing the configuration set name, optional no-tracking hint, and the original SES error message.
  • Preserve original error context using Error's cause option.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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.

2 participants