Describe the bug
In a multilingual installation, a journal manager can create an announcement in more than one language, based on journal settings. However, when this email is ultimately sent to the user base, the language chosen for the announcement message body is based on the UI choice of the user who is creating the announcement.
The MailTemplate is built using the current user's locale since no locale is passed into the constructor:
This poses a problem in multilingual journals because users who may not speak the language of the person crafting the announcement end up receiving an email that they cannot understand. This leads to emails being ignored or possibly marked as spam.
The difficulty with fixing this right now is that we do not currently store a user's language preference, although the issue is still open:
A possible work around right now would be including all language versions of an announcement in the email, although this becomes unwieldy if there are many languages in the UI.
To Reproduce
Steps to reproduce the behavior:
Create an announcement in a multilingual installation
Send the announcement to users and toggle the UI of the interface between tries
Users will receive an announcement based on the UI of the sender
What application are you using?
OJS 3.3.0.17
Note: this may affect other emails as well. We've only really noticed it happening with announcements though.
Describe the bug In a multilingual installation, a journal manager can create an announcement in more than one language, based on journal settings. However, when this email is ultimately sent to the user base, the language chosen for the announcement message body is based on the UI choice of the user who is creating the announcement.
The MailTemplate is built using the current user's locale since no locale is passed into the constructor:
https://github.com/pkp/pkp-lib/blob/stable-3_3_0/classes/notification/managerDelegate/AnnouncementNotificationManager.inc.php#L103
Calling:
https://github.com/pkp/pkp-lib/blob/stable-3_3_0/classes/mail/MailTemplate.inc.php#L64
This poses a problem in multilingual journals because users who may not speak the language of the person crafting the announcement end up receiving an email that they cannot understand. This leads to emails being ignored or possibly marked as spam.
The difficulty with fixing this right now is that we do not currently store a user's language preference, although the issue is still open:
https://github.com/pkp/pkp-lib/issues/7702
A possible work around right now would be including all language versions of an announcement in the email, although this becomes unwieldy if there are many languages in the UI.
To Reproduce Steps to reproduce the behavior:
What application are you using? OJS 3.3.0.17
Note: this may affect other emails as well. We've only really noticed it happening with announcements though.