Skip to content

Commit

Permalink
MDL-83265 course: user placeholders for request approval notification.
Browse files Browse the repository at this point in the history
  • Loading branch information
paulholden committed Dec 17, 2024
1 parent a97ddeb commit c8a4c28
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions course/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -2633,8 +2633,14 @@ public function approve() {
$this->delete();

$a = new stdClass();
$a->name = format_string($course->fullname, true, array('context' => context_course::instance($course->id)));
$a->url = $CFG->wwwroot.'/course/view.php?id=' . $course->id;
$a->name = format_string($course->fullname, true, ['context' => $context]);
$a->url = course_get_url($course);

$usernameplaceholders = \core\user::get_name_placeholders($user);
foreach ($usernameplaceholders as $field => $value) {
$a->{$field} = $value;
}

$this->notify($user, $USER, 'courserequestapproved', get_string('courseapprovedsubject'), get_string('courseapprovedemail2', 'moodle', $a), $course->id);

return $course->id;
Expand Down

0 comments on commit c8a4c28

Please sign in to comment.