postmark-dotnet icon indicating copy to clipboard operation
postmark-dotnet copied to clipboard

CreateServerAsync now fails if you don't specify a color

Open matthoneycutt-sm opened this issue 2 years ago • 4 comments

We've been using this library for years, and we've never specified a color when calling CreateServerAsync. Previously, a random color would be assigned. Starting yesterday, we began randomly receiving this error: PostmarkDotNet.Exceptions.PostmarkValidationException: Please choose either Purple, Blue, Turquoise, Green, Red, Orange, Yellow, or Grey for server color.

Looking at the code, if we don't pass a color, the "color" attribute is still sent to the Postmark API, but it has a value of null. I'm guessing that used to work, but a change on the Postmark API must have disabled that.

Here's the code that's failing now:

var newServer = await postmarkClient.CreateServerAsync(newCompany.PostmarkServerName,
                inboundHookUrl: $"{_postmarkWebhookUrlBase}/inbound?x-webhook-auth=1B5D4B28-C166-4392-AD01-9DC00B4B1217",
                openHookUrl: $"{_postmarkWebhookUrlBase}/opened?x-webhook-auth=1B5D4B28-C166-4392-AD01-9DC00B4B1217",
                deliveryHookUrl: $"{_postmarkWebhookUrlBase}/delivered?x-webhook-auth=1B5D4B28-C166-4392-AD01-9DC00B4B1217",
                bounceHookUrl: $"{_postmarkWebhookUrlBase}/bounced?x-webhook-auth=1B5D4B28-C166-4392-AD01-9DC00B4B1217",
                trackOpens: true,
                trackLinks: LinkTrackingOptions.HtmlAndText,
                smtpApiActivated: false,
                enableSmtpApiErrorHooks: false
            );

matthoneycutt-sm avatar Sep 13 '24 16:09 matthoneycutt-sm

@matthoneycutt-sm thank you for reporting this! You are correct about the change to the API, however this change was not intentional. I'm going to be deploying a fix shortly.

jchoca avatar Sep 13 '24 17:09 jchoca

@jchoca Great, thank you!

matthoneycutt-sm avatar Sep 13 '24 18:09 matthoneycutt-sm

@matthoneycutt-sm fix was deployed. Let us know if it's still not working or you run into any other issues.

jchoca avatar Sep 13 '24 19:09 jchoca

Just tested it out, all good! Thank you so much for the fast response.

matthoneycutt-sm avatar Sep 13 '24 19:09 matthoneycutt-sm