Fixed email language selection, #3527

This commit is contained in:
Ylian Saint-Hilaire 2022-01-24 07:54:56 -08:00
parent 836ad768ac
commit 19dfb43f30

View File

@ -66,6 +66,7 @@ module.exports.CreateMeshMail = function (parent, domain) {
function getTemplate(name, domain, lang) { function getTemplate(name, domain, lang) {
parent.debug('email', 'Getting mail template for: ' + name + ', lang: ' + lang); parent.debug('email', 'Getting mail template for: ' + name + ', lang: ' + lang);
if (Array.isArray(lang)) { lang = lang[0]; } // TODO: For now, we only use the first language given. if (Array.isArray(lang)) { lang = lang[0]; } // TODO: For now, we only use the first language given.
if (lang != null) { lang = lang.split('-')[0]; } // Take the first part of the language, "xx-xx"
var r = {}, emailsPath = null; var r = {}, emailsPath = null;
if ((domain != null) && (domain.webemailspath != null)) { emailsPath = domain.webemailspath; } if ((domain != null) && (domain.webemailspath != null)) { emailsPath = domain.webemailspath; }