• Welcome to Simple Machines Community Forum. Please login or sign up.

[2.1] Mail template partly rendered in language of posting, not receiving, user?

Started by m4z, February 18, 2020, 03:35:16 PM

Previous topic - Next topic


Today I received a notification (my forum language is English):

Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

A new topic, '<redacted>', has been made on a board you are watching.

You can see it at

More topics may be posted, but you won't receive more email notifications until you return to the board and read some of them.

Unsubscribe to new topics from this board by using this link:

El equipo de Simple Machines Community Forum.

Notice the complimentary close. I checked, and the user who created the topic has his language set to Spanish Latin.

(I suspected this for quite some time, because some weeks back, I had the same issue with closing asian characters.)
"Faith is what you have in things that don't exist."
--Homer Simpson

Es gibt hier im Forum ein deutsches Support-Board!
<werbung>Meine Freundin hat ihr erstes Buch veröffentlicht!</werbung>


i know this has been reported before, right now i cannot locate the existing bug on this issue.


After reading and sifting through the code,  (very complex and hard to reed!)I think  can envision a possibility of something similar happening. Note that it  isn't associated with the poster's language.

We are dealing with two different language files here.

User A is English, everything is loaded fine for them.
User B is Spanish, everything is loaded fine for them.
User C is English, the signature text is reused from Spanish.

The code that loads the email template is fine  and reloads language every time.

Find in ./Sources/tasks/CreatePost-Notify.php at line 255

if (empty($parsed_message[$localization]))

Replace with

// if (empty($parsed_message[$localization]))

NB: The same notify path is used for both new topics and new replies as well as moderation actions on topics  that you watch.


Confirmed, & logged here: 

I am definitely seeing issues, specifically with the salutation - exactly as noted above. 

Note it is an intermittent issue - it worked fine for my first 3 or 4 mail notifications, before failing a couple of times. 
Address the process rather than the outcome.  Then, the outcome becomes more likely.   - Fripp


I think that it can become a persistent thing if all three user's notifications get queued up and run at once. Might need to cripple cron for that.


also this is not just an issue for SMF 2.1 as this topic is flagged. we have seen this many times here on sm.org.


Address the process rather than the outcome.  Then, the outcome becomes more likely.   - Fripp