Commit cdc0f4de authored by Dan Poltawski's avatar Dan Poltawski
Browse files

Merge branch 'MDL-49677' of https://github.com/sleperf/moodle

parents 8cf919bc ab2fa7a7
......@@ -32,7 +32,9 @@ $string['customwelcomemessage_help'] = 'A custom welcome message may be added as
The following placeholders may be included in the message:
* Course name {$a->coursename}
* Link to user\'s profile page {$a->profileurl}';
* Link to user\'s profile page {$a->profileurl}
* User email {$a->email}
* User fullname {$a->fullname}';
$string['defaultrole'] = 'Default role assignment';
$string['defaultrole_desc'] = 'Select role which should be assigned to users during self enrolment';
$string['enrolenddate'] = 'End date';
......
......@@ -412,8 +412,9 @@ class enrol_self_plugin extends enrol_plugin {
if (trim($instance->customtext1) !== '') {
$message = $instance->customtext1;
$message = str_replace('{$a->coursename}', $a->coursename, $message);
$message = str_replace('{$a->profileurl}', $a->profileurl, $message);
$key = array('{$a->coursename}', '{$a->profileurl}', '{$a->fullname}', '{$a->email}');
$value = array($a->coursename, $a->profileurl, fullname($user), $user->email);
$message = str_replace($key, $value, $message);
if (strpos($message, '<') === false) {
// Plain text only.
$messagetext = $message;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment