Skip to content

Commit

Permalink
use the site default language for Mail template
Browse files Browse the repository at this point in the history
  • Loading branch information
carlitorweb committed May 5, 2024
1 parent b13a47a commit c375030
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion administrator/components/com_users/src/Model/UserModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -492,12 +492,15 @@ public function activate(&$pks)
$mailData['mailfrom'] = $app->get('mailfrom');
$mailData['sitename'] = $app->get('sitename');

// Load com_users site language strings, the mail template use it
$app->getLanguage()->load('com_users', JPATH_SITE);

$sendMailTo = function ($userData) use ($app, $mailData) {
$mailData['name'] = $userData['name'];
$mailData['username'] = $userData['username'];

// Use the default language
$langTag = ComponentHelper::getParams('com_languages')->get('administrator', 'en-GB');
$langTag = ComponentHelper::getParams('com_languages')->get('site', 'en-GB');

$mailer = new MailTemplate('com_users.registration.user.admin_activated', $langTag);
$mailer->addTemplateData($mailData);
Expand Down

0 comments on commit c375030

Please sign in to comment.