mailjet / mailjet-gem

[API v3] Mailjet official Ruby GEM

Home Page:https://dev.mailjet.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

boardfish opened this issue · comments

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.

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.