ActiveCampaign / postmark-dotnet

A .NET library for the Postmark API
http://developer.postmarkapp.com/
Other
50 stars 46 forks source link

PostmarkMessage constructor ignores value of headers argument #55

Closed lucaspimentel closed 6 years ago

lucaspimentel commented 6 years ago

The following PostmarkMessage constructor overload ignores the headers argument and instead always create a new HeaderCollection:

PostmarkMessage(string from,
                string to,
                string subject,
                string textBody,
                string htmlBody,
                HeaderCollection headers = null)

Line 33 of PostmarkMessage.cs is currently

Headers = headers = new HeaderCollection();

but should probably be

Headers = headers ?? new HeaderCollection();

I created pull request #54 to fix this issue.

atheken commented 6 years ago

Thanks! This will go out in the next release.