Skip to content

Commit a528f9c

Browse files
committed
MDL-86905 core: Use proper link markup for email links
1 parent aa24806 commit a528f9c

5 files changed

Lines changed: 39 additions & 65 deletions

File tree

auth/oauth2/classes/api.php

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -197,9 +197,7 @@ public static function send_confirm_link_login_email($userinfo, $issuer, $userid
197197

198198
$data->link = $confirmationurl->out(false);
199199
$message = get_string('confirmlinkedloginemail', 'auth_oauth2', $data);
200-
201-
$data->link = $confirmationurl->out();
202-
$messagehtml = text_to_html(get_string('confirmlinkedloginemail', 'auth_oauth2', $data), false, false, true);
200+
$messagehtml = text_to_html(get_string('confirmlinkedloginemail', 'auth_oauth2', $data), false, false);
203201

204202
$user->mailformat = 1; // Always send HTML version as well.
205203

@@ -339,9 +337,7 @@ public static function send_confirm_account_email($userinfo, $issuer) {
339337

340338
$data->link = $confirmationurl->out(false);
341339
$message = get_string('confirmaccountemail', 'auth_oauth2', $data);
342-
343-
$data->link = $confirmationurl->out();
344-
$messagehtml = text_to_html(get_string('confirmaccountemail', 'auth_oauth2', $data), false, false, true);
340+
$messagehtml = text_to_html(get_string('confirmaccountemail', 'auth_oauth2', $data), false, false);
345341

346342
$user->mailformat = 1; // Always send HTML version as well.
347343

auth/oauth2/lang/en/auth_oauth2.php

Lines changed: 7 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -27,19 +27,14 @@
2727
$string['auth_oauth2settings'] = 'OAuth 2 authentication settings.';
2828
$string['confirmaccountemail'] = 'Hi {$a->firstname},
2929
30-
A new account has been requested at \'{$a->sitename}\'
31-
using your email address.
30+
A new account has been requested at \'{$a->sitename}\' using your email address.
3231
33-
To confirm your new account, please go to this web address:
32+
To confirm your new account, please click the link below:
3433
35-
{$a->link}
34+
<a href="{$a->link}">Confirm your account</a>
3635
37-
In most mail programs, this should appear as a blue link
38-
which you can just click on. If that doesn\'t work,
39-
then cut and paste the address into the address
40-
line at the top of your web browser window.
4136
42-
If you need help, please contact the site administrator,
37+
If you need help, please contact the site administrator.
4338
{$a->admin}
4439
4540
If you did not do this, someone else could be trying to compromise your account.
@@ -53,16 +48,12 @@
5348
{$a->linkedemail} to your account at \'{$a->sitename}\'
5449
using your email address.
5550
56-
To confirm this request and link these logins, please go to this web address:
51+
To confirm this request and link these logins, please click the link below:
5752
58-
{$a->link}
53+
<a href="{$a->link}">Link your accounts</a>
5954
60-
In most mail programs, this should appear as a blue link
61-
which you can just click on. If that doesn\'t work,
62-
then cut and paste the address into the address
63-
line at the top of your web browser window.
6455
65-
If you need help, please contact the site administrator,
56+
If you need help, please contact the site administrator.
6657
{$a->admin}
6758
6859
If you did not do this, someone else could be trying to compromise your account.

lang/en/admin.php

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -825,16 +825,12 @@
825825
Your account with username {$a->username} on server \'{$a->sitename}\'
826826
was locked out after multiple invalid login attempts.
827827
828-
To unlock the account immediately go to the following address
828+
To unlock the account immediately, please click the link below:
829829
830-
{$a->link}
830+
<a href="{$a->link}">Unlock account</a>
831831
832-
In most mail programs, this should appear as a blue link
833-
which you can just click on. If that doesn\'t work,
834-
then copy and paste the address into the address
835-
line at the top of your web browser window.
836832
837-
If you need help, please contact the site administrator,
833+
If you need help, please contact the site administrator.
838834
{$a->admin}';
839835
$string['lockoutemailsubject'] = 'Your account on {$a} was locked out';
840836
$string['lockouterrorunlock'] = 'Invalid account unlock information supplied.';

lang/en/auth.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,14 @@
7979
$string['emailupdate'] = 'Email address update';
8080
$string['emailupdatemessage'] = 'Hi {$a->firstname},
8181
82-
You have requested a change of your email address for your account on {$a->site}. To confirm this change, please go to the following web address:
82+
You have requested a change of your email address for your account on {$a->site}.
8383
84-
{$a->url}
85-
The confirmation link will expire in <b>10 minutes</b>.
84+
To confirm this change, please click the link below:
85+
86+
<a href="{$a->url}">Confirm email change</a>
87+
88+
89+
The confirmation link will expire in <strong>10 minutes</strong>.
8690
8791
{$a->supportemail}';
8892
$string['emailupdatesuccess'] = 'Email address of user <em>{$a->fullname}</em> was successfully updated to <em>{$a->email}</em>.';

lang/en/moodle.php

Lines changed: 20 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -649,17 +649,12 @@
649649
$string['emailconfirm'] = 'Confirm your account';
650650
$string['emailconfirmation'] = 'Hi {$a->firstname},
651651
652-
A new account has been requested at \'{$a->sitename}\'
653-
using your email address.
652+
A new account has been requested at \'{$a->sitename}\' using your email address.
654653
655-
To confirm your new account, please go to this web address:
654+
To confirm your new account, please click the link below:
656655
657-
{$a->link}
656+
<a href="{$a->link}">Confirm your account</a>
658657
659-
In most mail programs, this should appear as a blue link
660-
which you can just click on. If that doesn\'t work,
661-
then cut and paste the address into the address
662-
line at the top of your web browser window.
663658
664659
If you need help, please contact the site administrator,
665660
{$a->admin}';
@@ -706,20 +701,14 @@
706701
$string['emailonlyallowed'] = 'This email cannot be used. Allowed email domains are: {$a}.';
707702
$string['emailpasswordconfirmation'] = 'Hi {$a->firstname},
708703
709-
Someone (probably you) has requested a new password for your
710-
account on \'{$a->sitename}\'.
704+
Someone (probably you) has requested a new password for your account on \'{$a->sitename}\'.
711705
712-
To confirm this and have a new password sent to you via email,
713-
go to the following web address:
706+
To confirm this and have a new password sent to you via email, please click the link below:
714707
715-
{$a->link}
708+
<a href="{$a->link}">Get a new password</a>
716709
717-
In most mail programs, this should appear as a blue link
718-
which you can just click on. If that doesn\'t work,
719-
then cut and paste the address into the address
720-
line at the top of your web browser window.
721710
722-
If you need help, please contact the site administrator,
711+
If you need help, please contact the site administrator.
723712
{$a->admin}';
724713
$string['emailpasswordconfirmationsubject'] = '{$a}: Change password confirmation';
725714
$string['emailpasswordconfirmmaybesent'] = '<p>If you supplied a correct username or unique email address then an email should have been sent to you.</p>
@@ -735,19 +724,14 @@
735724
If you continue to have difficulty, contact the site administrator.';
736725
$string['emailpasswordchangeinfo'] = 'Hi {$a->firstname},
737726
738-
Someone (probably you) has requested a new password for your
739-
account \'{$a->username}\' on \'{$a->sitename}\'.
727+
Someone (probably you) has requested a new password for your account \'{$a->username}\' on \'{$a->sitename}\'.
740728
741-
To change your password, please go to the following web address:
729+
To change your password, please click the link below:
742730
743-
{$a->link}
731+
<a href="{$a->link}">Change password</a>
744732
745-
In most mail programs, this should appear as a blue link
746-
which you can just click on. If that doesn\'t work,
747-
then cut and paste the address into the address
748-
line at the top of your web browser window.
749733
750-
If you need help, please contact the site administrator,
734+
If you need help, please contact the site administrator.
751735
{$a->admin}';
752736
$string['emailpasswordchangeinfodisabled'] = 'Hi {$a->firstname},
753737
@@ -764,14 +748,17 @@
764748
765749
A password reset was requested for your account \'{$a->username}\' at {$a->sitename}.
766750
767-
To confirm this request, and set a new password for your account, please go to the following web address:
768-
<a href="{$a->link}">{$a->link}</a>
751+
To confirm this request, and set a new password for your account, please click the link below:
752+
753+
<a href="{$a->link}">Reset password</a>
754+
769755
770756
(This link is valid for {$a->resetminutes} minutes from the time this reset was first requested.)
771757
772758
If this password reset was not requested by you, no action is needed.
773759
774-
If you need help, please contact the site administrator, {$a->admin}';
760+
If you need help, please contact the site administrator.
761+
{$a->admin}';
775762
$string['emailresetconfirmationsubject'] = '{$a}: Password reset request';
776763
$string['emailresetconfirmsent'] = 'An email has been sent to your address at <b>{$a}</b>.
777764
<br />It contains easy instructions to confirm and complete this password change.
@@ -1513,10 +1500,10 @@
15131500
15141501
(You will be prompted to change your password when you log in for the first time.)
15151502
1516-
To start using \'{$a->sitename}\', log in at
1517-
{$a->link}
15181503
1519-
If you need help, contact the site administrator,
1504+
<a href="{$a->link}">Click to log in</a> and start using \'{$a->sitename}\'.
1505+
1506+
If you need help, contact the site administrator.
15201507
{$a->signoff}';
15211508
$string['newusers'] = 'New users';
15221509
$string['newwindow'] = 'New window';

0 commit comments

Comments
 (0)