mailtrain
mailtrain copied to clipboard
Encoding problem with merge tags and Gmail
I'm experiencing a problem with encoding on Gmail side.
Example email content:
Cześć [FIRST_NAME]!
Where the FIRST_NAME is "Michał". The user will see it as follows:
Cześć Michał!
The source of the email looks like follows:
Cze=C5=9B=C4=87 Michał!
The non-merge-tag characters are encoded email like, but the merge tag special character is encoded the html way and Gmail can't handle it properly. Thunderbird displays the message properly.
I've already tried changing the encoding (first line of email body) to:
-
<meta charset="utf-8">
-
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
-
<meta charset="utf-8" http-equiv="Content-Type" content="text/html; charset=utf-8">
No luck though. Any idea how to tackle this issue?
Same issue, just posted a duplicate I believe. If someone can test that on v2, it would be great (If it works, we will migrate :)).
Reproducible in V2
Any plans to address that? It's not like this is a minor issue, 250M people use Cyrillic. I will try to find the issue in the source code.
Any plans to address that? It's not like this is a minor issue, 250M people use Cyrillic. I will try to find the issue in the source code.
Try this - https://github.com/D4rk4/mailtrain/commit/da2e945906774b49dd9aa0df73dc3fc934b2e837
Това коригира грешка с кирилица. Но не съм сигурен, че разработчиците някога ще поправят това.
Thanks for the solution, @D4rk4 ! Will try it promptly on V2 code.
Thanks for the solution, @D4rk4 ! Will try it promptly on V2 code.
It's a very dirty hack. I'm not a NodeJS developer. If you experienced with NodeJS, please just replace he.encode to another solution with Cyrillic support.
The whole notion of HTML encoding characters in the body of an e-mail is plain wrong. It doesn’t only botch Cyrillic, it messes with all non-standard characters. So, we don’t need to replace he.encode, we need to get rid of it.
The encoding with he has been adopted from Mailtrain v1. I'm not sure why @andris9 introduced it there, but I'm quite confident he must have had some reason for it. I'll be happy to drop the encoding, but first I would like to have understanding why it was there and what could get bad by removing it. We should also properly test it with different mail clients (Outlook is definitely one of those).
@bures without HTML encoding Outlook working with Cyrillic merge tags like a charm. Also tested in Gmail.
@D4rk4 - Just to double check, you mean Outlook desktop app, right? (Not the web-based Outlook in M365.)
@andris9 - Please, any idea why the html entity encoding was introduced there? Thanks.
@D4rk4 - Just to double check, you mean Outlook desktop app, right? (Not the web-based Outlook in M365.)
OWA and desktop app.
Thanks. Win or Mac?
Thanks. Win or Mac?
Win
Up! Still not fixed in V2
@bures Any progress with remove "he.encode"?
So, any progress?
I'm using a widely patched version of MT without he.encode a couple of years, without any issues with encoding. Please remove he.encode, from the main tree...
@bures
@D4rk4 you can make a pull request.
@talheim-it this pull request? https://github.com/Mailtrain-org/mailtrain/pull/969
@D4rk4 is it v2 approved? If yes I will check to reach @bures for verification.
I just had not time to dig into the code.
I'm do new one for fresh code
@D4rk4 thanks, mention me and I am behind to treach him!
https://github.com/Mailtrain-org/mailtrain/pull/1252
We are going to start with the development and testing of mailtrain v3 in the next weeks.
You are welcome to help us with the testing as soon as the first release candidate is available.