mailjet / mailjet-gem

[API v3] Mailjet official Ruby GEM
https://dev.mailjet.com
Other
130 stars 72 forks source link

Setting `from` and `reply_to` to `nil` or `''` causes 400 Bad Request #221

Closed boardfish closed 3 years ago

boardfish commented 3 years ago

In order to use the sender defined within a Mailjet template, I'm trying to pass a blank From and ReplyTo parameter. When I pass the email as '', the parameters to the request are set to "ReplyTo"=>{"Email"=>nil}, "From"=>{"Email"=>nil}. The API then returns a 400 Bad Request status code.

boardfish commented 3 years ago

I've set default_from to '' against the Mailjet config. Setting the from and reply_to to nil at every other level (i.e. also in Devise config if necessary) meant it cascaded all the way back to default_from and used a blank sender.