How Special Symbols Can Affect Store Emails Delivery in Prestashop

March 9, 2016 Alex Simonchik Prestashop
How Special Symbols Can Affect Store Emails Delivery in Prestashop

Recently we faced the problem, that customers did not receive email notifications from the client’s Prestashop installation.

For a long time we couldn’t reproduce this issue: MTA settings were correct, Mandrill API did not return any errors. Issue exited only for a couple customers, while hundreds did not get such error at all.

Luckily we new the email address of one of clients who complained about the issue, so we created additional development instance and replaced customer’s email with ours. So now we could repeat all process like a real customer with his unique data. We tried to send an email for this user (the email was supposed to go to our email address). And we didn’t receive any. This current Prestashop installation uses Mandrill as the SMTP server, but there was no any information about customer’s emails in the “Outbound” section. Though debug log showed that the API call to the Mandrill was sent and did not return any error.

To cut a long story short, after some time we finally spotted the problem. The thing was that customer used Danish special characters (such as Æ,Ø, Å) in his username. Also we found the following post on the forum.

The solution was to encode “To name” field with the base64 encoding. After this fix all letters were delivered to the client.

Our solution was to make override for the class of the function Mail::Send



1 comment

  1. Hi Alex,

    Nice catch! My emails were going out (using Mailgun), but occasionally with a “to” title of e.g. “=?UTF-8?B?TcKqIGRlbCBNYXIgR29tZXogQmFycm9zbw==? “. Your fix solved my problem.
    I don’t have special characters in our “from” field, but I would imagine the problem would be the same there, correct?

    Thanks!
    Ed Eichman
    http://www.lentillas.si

Post a new comment

top
BelVG Newsletter
Subscribe to our mailing list and get interesting stuff and updates to your email inbox.
Email *