You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As #158 points out, there is an issue with this lib when trying to use an utf8 encoded emoji (such as this one 😀) in the SubjectHtml-part or Text-part of a campaign/transactional mail.
I sadly don't have the time to create a PR but here is the reason why it happens and a potential fix in case someone else wants to fix it or runs into it.
Guzzle is used under the hood to make the http requests and this lib uses the json request option when sending json data in the body (which happens for most endpoints). When this option is used, Guzzle automatically sets the content-type header and wraps the body like this json_encode($body) before sending the request. This breaks the emojis.
A potential fix for this lib would be to not use the json option and instead manually add the correct content-type header and encode the body like so json_encode($body, JSON_UNESCAPED_UNICODE) as it doesn't break emojis.
Hope this might be of help.
The text was updated successfully, but these errors were encountered:
As #158 points out, there is an issue with this lib when trying to use an utf8 encoded emoji (such as this one 😀) in the SubjectHtml-part or Text-part of a campaign/transactional mail.
I sadly don't have the time to create a PR but here is the reason why it happens and a potential fix in case someone else wants to fix it or runs into it.
Guzzle is used under the hood to make the http requests and this lib uses the json request option when sending json data in the body (which happens for most endpoints). When this option is used, Guzzle automatically sets the content-type header and wraps the body like this json_encode($body) before sending the request. This breaks the emojis.
A potential fix for this lib would be to not use the json option and instead manually add the correct content-type header and encode the body like so json_encode($body, JSON_UNESCAPED_UNICODE) as it doesn't break emojis.
Hope this might be of help.
Hello @kilbiller
Thank you for your notice. We will try this solution and test
Hello,
As #158 points out, there is an issue with this lib when trying to use an utf8 encoded emoji (such as this one 😀) in the
Subject
Html-part
orText-part
of a campaign/transactional mail.I sadly don't have the time to create a PR but here is the reason why it happens and a potential fix in case someone else wants to fix it or runs into it.
Guzzle is used under the hood to make the http requests and this lib uses the json request option when sending json data in the body (which happens for most endpoints). When this option is used, Guzzle automatically sets the
content-type
header and wraps the body like thisjson_encode($body)
before sending the request. This breaks the emojis.A potential fix for this lib would be to not use the
json
option and instead manually add the correctcontent-type
header and encode the body like sojson_encode($body, JSON_UNESCAPED_UNICODE)
as it doesn't break emojis.Hope this might be of help.
The text was updated successfully, but these errors were encountered: