PMK-2660 - Add missing webhook payload models (Click, SpamComplaint, SubscriptionChange) - #157
Merged
Merged
Conversation
…SubscriptionChange) The library had webhook payload models for only 4 of the documented webhook record types. This adds type-safe models for three more: - PostmarkClickWebhookMessage : PostmarkClick (adds ClickLocation, ReceivedAt, Tag, Recipient, Metadata) - supersedes stalled PR #146 / issue #145. - PostmarkSpamComplaintWebhookMessage : PostmarkBounce (adds TypeCode, Content, Metadata) - mirrors the existing PostmarkBounceWebhookMessage pattern. - PostmarkSubscriptionChangeWebhookMessage - standalone model. Property casing was taken verbatim from the public Postmark webhook docs to match the case-sensitive System.Text.Json defaults consumers use. Scope note: the ticket also proposed a PostmarkSmtpApiErrorWebhookMessage and an SmtpApiError webhook-configuration trigger. Both were intentionally omitted: SMTP API Error is not a distinct webhook record type but a Bounce with Type = SMTPApiError (already present as PostmarkBounceType.SMTPApiError), and the webhook Triggers API supports only the six triggers already modeled. postmark.js models neither, confirming the gap does not exist. EnableSmtpApiErrorHooks on PostmarkServer is a separate server-level setting, not a config trigger. Adds WebhookMessageDeserializationTests covering the documented example payloads, including a subscription-change reactivation edge case. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- Bump <Version> to 5.4.1. - Add a NuGet package README (PackageReadmeFile) so the published package no longer warns about a missing readme. The prior release (5.4.0) shipped with no <readme> element in its nuspec. Includes a "What's New" section covering the 5.4.1 webhook payload models and the 5.4.0 Bulk Email API. Note: CI derives the published version from the git tag, so tagging 5.4.1 on main is what triggers the NuGet publish; the csproj bump keeps local packs in sync. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
Summary
Adds type-safe webhook payload models for three documented Postmark webhook record types that the library was missing:
PostmarkClickWebhookMessage:PostmarkClick— addsClickLocation,ReceivedAt,Tag,Recipient,Metadata. Closes PostmarkClickWebhookMessage not in Models #145 and supersedes the stalled Create PostmarkClickWebhookMessage #146 (that PR's file had no.csextension, used tabs, had a copy-paste doc comment, and was missingClickLocation).PostmarkSpamComplaintWebhookMessage:PostmarkBounce— addsTypeCode,Content,Metadata, mirroring the existingPostmarkBounceWebhookMessagepattern.PostmarkSubscriptionChangeWebhookMessage— standalone model.Property casing is taken verbatim from the public Postmark webhook docs to match the case-sensitive
System.Text.Jsondefaults consumers use.Scope decision (deviates from the ticket)
The ticket (PMK-2660) also proposed a
PostmarkSmtpApiErrorWebhookMessageand anSmtpApiErrorwebhook-configuration trigger. Both were intentionally omitted — they are based on a misconception:Type = SMTPApiError, which already exists asPostmarkBounceType.SMTPApiError(100007).PostmarkServer.EnableSmtpApiErrorHooksis a separate server-level setting, not a configuration trigger; adding a trigger property would send an unsupported field to the API.Testing
Adds
WebhookMessageDeserializationTestsdeserializing the documented example payloads for all three models, including a subscription-change reactivation edge case (SuppressSending = false→ nullSuppressionReason/Tag, emptyMetadata).The test project targets
netcoreapp3.1; models were additionally verified against the built library on a modern runtime (33/33 field assertions pass). Both projects build clean.🤖 Generated with Claude Code