sendgrid-rs
sendgrid-rs copied to clipboard
Personalization requires at least one email which isn't convenient
I just noticed that since certain commit, Personalization
needs to provide at least one email, this isn't convenient.
Because in one email we often have multiple receivers, it's normal to build an empty Personalization and then loop through the list of receivers.
However, with the latest change, we need to do:
let mut p = Personalization::new(Email::new(receivers.remove(0))
p.add_to(..)
comparing to:
let mut p = Personalization::new()
p.add_to(..)
Hey, sorry that this is a little bit of a paper cut for the API. I'd be willing to add an Email::many
API that accepts a vector of receivers if that would help.