mailjet / mailjet-gem

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

Emails with accents #178

Closed jdescelliers closed 3 years ago

jdescelliers commented 5 years ago

Hi,

When using the API, I encontered an error for an illegal character when an email contains an accent.

While uncommun, is there any plans for mailJet to support mails with accents?

adaRn commented 5 years ago

Hi @jdescelliers , I think as for now you could easily do with escaping these emails, just like in the workaround I've posted here https://github.com/mailjet/mailjet-gem/issues/145

MathieuDerelle commented 5 years ago

I've got the same issue.

It is not our concern to escape emails, we do not know what other impact "escaping them" could have. Will mailjet search for escaped character as is or will they decode it ? :\

To provide more context :

when using Mailjet::Contact.find, I got the error :

URI::InvalidURIError: URI must be ascii only "https://api.mailjet.com/v3/REST/contact/xxx\u{e7}xxx@xxx.com"

(email redacted for privacy, apart from the faulty character)

with backtrace

vendor/ruby-2.3.4/lib/ruby/2.3.0/uri/rfc3986_parser.rb:21 in split
vendor/ruby-2.3.4/lib/ruby/2.3.0/uri/rfc3986_parser.rb:73 in parse
vendor/ruby-2.3.4/lib/ruby/2.3.0/uri/common.rb:227 in parse
/gems/rest-client-2.0.2/lib/restclient/request.rb:597 in parse_url_with_auth!
/gems/rest-client-2.0.2/lib/restclient/request.rb:72 in initialize
/gems/rest-client-2.0.2/lib/restclient/request.rb:52 in new
/gems/rest-client-2.0.2/lib/restclient/request.rb:52 in execute
/gems/rest-client-2.0.2/lib/restclient/resource.rb:51 in get
/gems/mailjet-1.5.4/lib/mailjet/connection.rb:67 in handle_api_call
/gems/mailjet-1.5.4/lib/mailjet/connection.rb:44 in get
/gems/mailjet-1.5.4/lib/mailjet/resource.rb:81 in find
xab3r commented 3 years ago

Fixed in v1.6.0