Skip to content

Updating webhook data fields#112

Open
adv76 wants to merge 5 commits into
resend:mainfrom
adv76:update-webhook-payload-types
Open

Updating webhook data fields#112
adv76 wants to merge 5 commits into
resend:mainfrom
adv76:update-webhook-payload-types

Conversation

@adv76

@adv76 adv76 commented May 5, 2026

Copy link
Copy Markdown
Contributor

Start work on #105. Added some fields to the email event data payload object and the audience id to contact event data.

Creating as a draft as there is more info needed to complete this (see #105 for discussion).


Summary by cubic

Update webhook payload models to match the latest Resend schema. Email events add inbound fields (bcc, cc, message_id, attachments) and new metadata (broadcast_id, template_id, tags, failed.reason, suppressed.{message,type}, bounce.diagnosticCode), and contact events add audience_id; all new fields are optional and ignored when null via JsonIgnore, and suppressed.type is fixed.

Written for commit c55cc55. Summary will update on new commits.

Review in cubic

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

1 issue found across 2 files

Confidence score: 4/5

  • This PR is likely safe to merge, with a minor serialization risk rather than a clear merge-blocker.
  • In src/Resend.Webhooks/EmailEventData.cs, nullable webhook fields may be emitted as explicit null values because JsonIgnoreCondition.WhenWritingNull was not applied, which can alter downstream JSON shape expectations.
  • Given the issue’s moderate-low severity (4/10) and focused scope to one model file, the overall regression risk appears limited.
  • Pay close attention to src/Resend.Webhooks/EmailEventData.cs - ensure nullable webhook properties don’t unintentionally change payload contracts by serializing as null.
Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="src/Resend.Webhooks/EmailEventData.cs">

<violation number="1" location="src/Resend.Webhooks/EmailEventData.cs:31">
P2: Nullable webhook fields were added without `JsonIgnoreCondition.WhenWritingNull`, so they can serialize as explicit nulls and change the emitted JSON shape.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

Comment thread src/Resend.Webhooks/EmailEventData.cs

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

1 issue found across 1 file (changes from recent commits).

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="src/Resend.Webhooks/EmailEventData.cs">

<violation number="1" location="src/Resend.Webhooks/EmailEventData.cs:71">
P1: `Suppressed` is typed as `EmailFailedData`, but the webhook payload and the newly added `EmailSuppressedData` model indicate it should use `EmailSuppressedData` instead.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

Comment thread src/Resend.Webhooks/EmailEventData.cs Outdated

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

0 issues found across 1 file (changes from recent commits).

Auto-approved: Low-risk additive change: adds optional fields and new model classes to webhook data payloads. All new fields are omitted when null via JsonIgnore, preserving backward compatibility. No logic changes,

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

0 issues found across 2 files (changes from recent commits).

Auto-approved: Adding optional fields to webhook models that match the latest Resend API schema is backward-compatible and low-risk; all new fields are nullable and ignored when null, so existing deserialization remains unaffected.
Re-trigger cubic

@adv76 adv76 marked this pull request as ready for review May 16, 2026 02:36

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

0 issues found across 1 file (changes from recent commits).

Auto-approved: These changes add optional fields to existing webhook data models to support new Resend schema fields, with all new properties marked as nullable and ignored when null, ensuring backward compatibility and minimal risk.

Re-trigger cubic

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