ActiveCampaign / postmark-dotnet

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

Introduce collections for addresses to the MessageBase and maintain compatibility #68

Closed OperatorOverload closed 1 year ago

OperatorOverload commented 5 years ago

This PR adds collections for the addresses which support multiple recipients (per the blog post here: https://postmarkapp.com/blog/postmark-now-with-multiple-recipients-support). Now that multiple addresses are available, providing native collections for management makes significantly more sense as it reduces the need for users to chop up strings manually in the case that their application logic needs to rewrite or remove individual addresses out of a set.

This approach specifically maintains compatibility with existing code by introducing property code which seamlessly translates between the original fields and the now-backing collection.

Test cases for the code is also included to ensure that future changes are validated appropriately.