Fixed email language selection, #3527
Ylian Saint-Hilaire committed
Jan 24, 2022 at 07:54 UTC
19dfb43f30dc5306b4b9ec30030f43987bd87813
1 file changed
+1
meshmail.js
+1
@@ -66,6 +66,7 @@ module.exports.CreateMeshMail = function (parent, domain) {
66
function getTemplate(name, domain, lang) {
67
parent.debug('email', 'Getting mail template for: ' + name + ', lang: ' + lang);
68
if (Array.isArray(lang)) { lang = lang[0]; } // TODO: For now, we only use the first language given.
69
+ if (lang != null) { lang = lang.split('-')[0]; } // Take the first part of the language, "xx-xx"
70
71
var r = {}, emailsPath = null;
72
if ((domain != null) && (domain.webemailspath != null)) { emailsPath = domain.webemailspath; }