pepipost / pepipost-sdk-php

The Official Pepipost PHP API library
https://pepipost.com
MIT License
21 stars 15 forks source link

Special chars like àèìòù are not passed correctly in email body ('content') #9

Closed realwahl closed 4 years ago

realwahl commented 6 years ago

I'm trying to send an email in italian, so it contains characters like àèìòù. I used the sample code, only that I added the string àèìòù to 'subject' and 'content'. The email arrives with the correct subject, but the content is "this ����� mail is sent via PHP SDK" instead of "this àèìòù mail is sent via PHP SDK". What can I do?

ivikramsahu commented 6 years ago

Hi @realwahl, Please pass rawurlencoded string in order to avoid junk characters. After rawurlencode it will look something like this '"subject":"Pepipost%20test%20%C3%A0%C3%A8%C3%AC%C3%B2%C3%B9'" For now the particular string "àèìòù" is in such format "subject":"Pepipost test \u00e0\u00e8\u00ec\u00f2\u00f9" which is junk character. Vikram | pepipost.com

realwahl commented 6 years ago

I managed to make it work using this workaround inside my code.

From a logical point of view thought, your library should call this function before sending it in GET or POST. On my side, I am passing an array to sendJson() and it should not be encoded in any way. The texts are UTF-8 as requested. It is the class that need to do the encoding, as it needs to send it in GET or post.

ivikramsahu commented 6 years ago

Thanks @realwahl it is a valuable suggestion which will surely help us alot. we will be updating our sdk in our upcoming release soon Regards, Vikram | pepipost.com

tazilios commented 4 years ago

Hello,

The issue is still present and is definitely a showstopper for us (as it will be for the majority or the european customers). Any chance to get this fixed before I move to another supplier?

ivikramsahu commented 4 years ago

Hey @tazilios, will check and update you on the same. Thanks.

ivikramsahu commented 4 years ago

Hello @tazilios, UTF8 character support has been added in the SDK, please check and let me know if in case of query. you can check the simple-usage.php Thanks.

tazilios commented 4 years ago

Hi Snipperbytes !

I'm actually using the API so I assume that it is the latest version... Anything else I can double check?

Cheers

tazilios commented 4 years ago

By the way, I also tested the encodeURIComponent function to rawurlencode the mail content but the special character are still wrong in the received email:

Pr�sentation � l'�quipe B (15-07-2020) * Nouveau point R�alis� par aBoard �

tazilios commented 4 years ago

I did upgrade to the latest version of the node.js package (5.0) but no change... Actually, I now see that you made the change in the PHP SDK. May I ask you to do the same change in the nodejs one?

ivikramsahu commented 4 years ago

Hey @tazilios,

Which SDK are you using PHP or node? Or both? I will make sure it gets fixed in other SDK too, but that will take time... so I appreciate your patience.

Cheers

tazilios commented 4 years ago

Thanks for coming back to me. I'm using the node one, if you can give it a priority, that would be great !

Cheers

tazilios commented 4 years ago

Hi,

It's been a month, any update on this?

Cheers

ivikramsahu commented 4 years ago

Hey @tazilios

We are already working on this part with few more feature addition in pipeline and planning to release probably by this week (5th August 2020). so I appreciate your patience.

Cheers

tazilios commented 4 years ago

Hello,

Any update for me? My pilot customers are complaining about it and I'd like to give them a date.

Cheers

ivikramsahu commented 4 years ago

Hey @tazilios,

The GitHub repo has been updated.. please go through the code

Cheers.

tazilios commented 4 years ago

Hello,

Thanks for informing me, I tested with the new package but.... image

...as you can see, the email still contains those error symbols in stead of the original ones.

Did you test the code with special characters like é è ?

Cheers

ivikramsahu commented 4 years ago

yeah, we tested @tazilios let me check it again and revert you with an update

thanks..