Skip to content

Commit 9ab86a4

Browse files
Merge pull request #7518 from christianbeeznest/GH-7506-2
Internal: Improve registration email confirmation layout - refs #7506
2 parents 77effc4 + 76deec0 commit 9ab86a4

2 files changed

Lines changed: 27 additions & 8 deletions

File tree

public/main/inc/lib/usermanager.lib.php

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5672,19 +5672,29 @@ public static function sendUserConfirmationMail(User $user)
56725672
$siteName = api_get_setting('platform.site_name');
56735673
$mailSubject = sprintf(get_lang('[%s] Confirm your e-mail'), $siteName);
56745674
$firstName = $user->getFirstname();
5675-
$mailBody = sprintf(get_lang('Dear %s,'), $firstName)
5676-
."\n\n"
5677-
.sprintf(get_lang('To verify your e-mail and enable your account on %s, please click the link below.'), $siteName)
5678-
."\n\n"
5679-
.Display::url($url, $url)
5680-
."\n\n"
5681-
.get_lang('If you did not register this account, you can ignore this e-mail. No action will be taken.');
5675+
$greeting = sprintf(get_lang('Dear %s,'), $firstName);
5676+
$intro = sprintf(
5677+
get_lang('To verify your e-mail and enable your account on %s, please click the link below.'),
5678+
$siteName
5679+
);
5680+
$outro = get_lang('If you did not register this account, you can ignore this e-mail. No action will be taken.');
5681+
5682+
$tpl = Container::getTwig();
5683+
$mailBodyHtml = $tpl->render(
5684+
'@ChamiloCore/Mailer/Legacy/user_email_confirmation.html.twig',
5685+
[
5686+
'greeting' => $greeting,
5687+
'intro' => $intro,
5688+
'outro' => $outro,
5689+
'url' => $url,
5690+
]
5691+
);
56825692

56835693
api_mail_html(
56845694
self::formatUserFullName($user),
56855695
$user->getEmail(),
56865696
$mailSubject,
5687-
$mailBody
5697+
$mailBodyHtml
56885698
);
56895699
Display::addFlash(Display::return_message(get_lang('Check your e-mail and follow the instructions.')));
56905700
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<p>{{ greeting }}</p>
2+
3+
<p>{{ intro }}</p>
4+
5+
<p><a href="{{ url }}">{{ url }}</a></p>
6+
7+
<p>{{ outro }}</p>
8+
9+
{% include '@ChamiloCore/Mailer/Legacy/_admin_signature_footer.html.twig' %}

0 commit comments

Comments
 (0)