vapor-community / sendgrid-kit

📧 A Swift on Server SDK for the SendGrid API
https://swiftpackageindex.com/vapor-community/sendgrid-kit
MIT License
10 stars 14 forks source link

Nested structure personalizations #7

Closed jstorm31 closed 3 weeks ago

jstorm31 commented 4 years ago

SendGrid supports structured data and arrays in dynamic templates data. It would be great if Personalization structure supported this as well. Right now it only supports [String: String] as dynamicTemplateData. I hope my observation isn't wrong, because I haven't tested SendGrid structured data payload yet. 😄

I'd suggest to replace it with [String: Encodable] or custom Encodable structure directly. I've had a look at the source code and it seems the update wouldn't be hard. I'll try to implement it when I have some time.