Add remaining missing webhook email data fields (#105)#127
Merged
Conversation
Completes EmailEventData parity with the Resend webhook payload (verified against public-api and the OpenAPI spec): - open (EmailOpenData: ipAddress, timestamp, userAgent) for email.opened - headers (List<EmailEventHeader>), present on all email events - received_for (EmailAddressList) for inbound email.received - suppressed.reason and suppressed.diagnosticCode Also corrects EmailEventAttachment to match the API: id is a string (not Guid; inbound attachment ids are not UUIDs), and filename, content_disposition and content_id are nullable.
There was a problem hiding this comment.
No issues found across 4 files
Confidence score: 5/5
- Automated review surfaced no issues in the provided summaries.
- No files require special attention.
Auto-approved: Adds missing webhook email fields (open, headers, received_for, suppressed) and fixes attachment ID type to prevent deserialization errors. Low-risk changes with accompanying tests.
Re-trigger cubic
This was referenced Jul 9, 2026
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.
Closes #105.
Completes
EmailEventDataparity with the Resend webhook payload. Field shapes verified against the server assembly (monorepo/apps/email-events-webhooks-consumer/src/utils/call-webhook.ts) and the OpenAPI spec. #112 added several fields but left these out:New fields
open(EmailOpenData:ipAddress,timestamp,userAgent) — set foremail.opened. MirrorsEmailClickDatawithoutlink. This was the most notable gap — opens are common and the payload was previously dropped.headers(List<EmailEventHeader>) — custom headers, present on every email event (inbound and outbound). Sent by the server as an array of{name, value}.received_for(EmailAddressList) — inboundemail.receivedonly.suppressed.reasonandsuppressed.diagnosticCode— the server sends{message, type, reason, diagnosticCode}; Updating webhook data fields #112 modeled onlymessage+type.Corrections to #112's attachment model
EmailEventAttachment.Id:Guid→string. The server types it as a plain string and inbound attachment ids are not UUIDs;Guidwould throw at deserialization. (The new inbound test uses"att_123"to cover this.)filename,content_disposition,content_idmade nullable to match the server (string | null).Tests
3 new raw-JSON deserialization tests in
Resend.Webhooks.Tests(real server-style payloads for opened, received, suppressed). Full suite on .NET 8: all pass (Webhooks 6/6).Note
suppressed.reason/typeare modeled asstring(documented enum values in remarks) rather than enums, consistent with the existingbounce.type/subTypetreatment in this file.Summary by cubic
Completes
EmailEventDataparity with the Resend webhook payload and fixes attachment modeling to match the API. Ensures open events, headers, inbound recipients, and suppression details deserialize correctly.New Features
open(EmailOpenData:ipAddress,timestamp,userAgent) foremail.opened.headers(List<EmailEventHeader>) on all events.received_for(EmailAddressList) for inboundemail.received.suppressed.reasonandsuppressed.diagnosticCode.Bug Fixes
EmailEventAttachment.Id:Guid→stringto prevent deserialization errors.filename,content_disposition,content_idare now nullable to match the server.Written for commit 55ebbba. Summary will update on new commits.