Skip to content

ENG-3301: Add threading header support to email providers (Story 2)#8122

Draft
JadeCara wants to merge 3 commits intoENG-3301/messaging-provider-refactor-pr2-sesfrom
ENG-3301/messaging-provider-refactor-story2
Draft

ENG-3301: Add threading header support to email providers (Story 2)#8122
JadeCara wants to merge 3 commits intoENG-3301/messaging-provider-refactor-pr2-sesfrom
ENG-3301/messaging-provider-refactor-story2

Conversation

@JadeCara
Copy link
Copy Markdown
Contributor

@JadeCara JadeCara commented May 6, 2026

Ticket ENG-3301

Description Of Changes

Adds threading header support to all 4 email providers. Extends EmailForActionType with optional reply_to, message_id, in_reply_to, references, and body_text fields. All fields default to None — existing callers are unaffected (backward compatible).

Switches AWS SES from send_email() (simple API) to send_raw_email() with MIME construction via email.message.EmailMessage for custom header support.

Code Changes

  • Extended EmailForActionType schema with 5 optional threading/envelope fields
  • Mailgun: maps to h:Reply-To, h:Message-ID, h:In-Reply-To, h:References, text
  • Twilio/SendGrid: maps to ReplyTo, Header objects, Content("text/plain", ...)
  • Mailchimp: maps to message.headers dict, message.text
  • AWS SES: switched to send_raw_email() with EmailMessage MIME construction
  • Updated SESClient type stub: send_email()send_raw_email()
  • New test_provider_headers.py — per-provider header mapping tests (headers present + absent)
  • New test_provider_map.pyPROVIDER_MAP completeness invariant test
  • Non-ASCII encoding tests for SES MIME (subjects + bodies)

Steps to Confirm

  1. No new callers use the threading fields yet — this is infrastructure for ENG-3299
  2. Send a test message via any configured email provider — verify it still sends successfully (backward compatibility; no threading fields set = no behavioral change)
  3. Confirm SES test messages still work (now uses send_raw_email internally)

Pre-Merge Checklist

  • Issue requirements met
  • All CI pipelines succeeded
  • CHANGELOG.md updated
    • Updates unreleased work already in Changelog, no new entry necessary
  • UX feedback:
    • No UX review needed
  • Followup issues:
    • Followup issues created
  • Database migrations:
    • No migrations
  • Documentation:
    • No documentation updates required

Stacked on #8120#8118 — merge those first.

🤖 Generated with Claude Code

@vercel
Copy link
Copy Markdown
Contributor

vercel Bot commented May 6, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

2 Skipped Deployments
Project Deployment Actions Updated (UTC)
fides-plus-nightly Ignored Ignored Preview May 6, 2026 6:59pm
fides-privacy-center Ignored Ignored May 6, 2026 6:59pm

Request Review

@JadeCara JadeCara force-pushed the ENG-3301/messaging-provider-refactor-pr2-ses branch from acc05e5 to ec08848 Compare May 6, 2026 18:10
JadeCara added a commit that referenced this pull request May 6, 2026
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@JadeCara JadeCara force-pushed the ENG-3301/messaging-provider-refactor-story2 branch from 916b01c to 64bee10 Compare May 6, 2026 18:15
@JadeCara JadeCara force-pushed the ENG-3301/messaging-provider-refactor-pr2-ses branch from ec08848 to b92ef93 Compare May 6, 2026 18:41
JadeCara and others added 3 commits May 6, 2026 12:51
Extend EmailForActionType with optional reply_to, message_id,
in_reply_to, references, and body_text fields. Map these to
provider-specific APIs in all 4 email providers:

- Mailgun: h:Reply-To, h:Message-ID, etc. + text field
- Twilio/SendGrid: ReplyTo, Header objects + Content text/plain
- Mailchimp: message.headers dict + message.text
- AWS SES: switch to send_raw_email with MIME construction via
  email.message.EmailMessage for custom header support

Add PROVIDER_MAP completeness invariant test and per-provider
header mapping tests including non-ASCII encoding coverage.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@JadeCara JadeCara force-pushed the ENG-3301/messaging-provider-refactor-story2 branch from 64bee10 to f07ce63 Compare May 6, 2026 18:59
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