Skip to content

Commit ae390ee

Browse files
committed
CTP-6359 Updated mailto subject to course fullname
1 parent c8e6e9d commit ae390ee

4 files changed

Lines changed: 5 additions & 3 deletions

File tree

classes/output/widgets/contacts.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,7 @@ public function get_course_contacts(renderer_base $output): array {
130130
$contact->role = $c['rolename'];
131131
$contact->roleshortname = $c['role']->shortname;
132132
$contact->email = $user->maildisplay == 0 ? null : $user->email;
133-
$subject = rawurlencode($course->fullname);
134-
$contact->subject = $user->maildisplay == 0 ? null : $subject;
133+
$contact->subject = rawurlencode($course->fullname);
135134

136135
// Can the current user edit this contact profile?
137136
if ($USER->id === $user->id) {

lang/en/format_ucl.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@
5858
$string['hiddenfromstudents'] = 'Hidden from students';
5959
$string['hidefromothers'] = 'Hide';
6060
$string['highlight'] = 'Highlight';
61-
$string['mailto:subject'] = '{$a->course} - {$a->contactname}';
6261
$string['messageprovider:expiry'] = 'Expiry message';
6362
$string['messageprovider:submission'] = 'Submission message';
6463
$string['name'] = 'Name';

templates/widgets/contacts/contact.mustache

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,11 @@
6363
<span class="mx-1">{{{name}}}</span>
6464
{{/custom}}
6565

66+
{{#email}}
6667
<a href="mailto:{{{email}}}?subject={{{subject}}}" target="_blank">
6768
<i class="fa-regular fa-envelope mr-1"></i>{{{email}}}
6869
</a>
70+
{{/email}}
6971

7072
{{#description}}
7173
<div class="small pt-1">{{{.}}}</div>

templates/widgets/contacts/contacts.mustache

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,9 @@
3131
{
3232
"id": 1,
3333
"name": "John Doe",
34+
"showemail": true,
3435
"email": "john.doe@example.com",
36+
"subject": "Course 1",
3537
"role": "Teacher",
3638
"picture": "<img src='path/to/picture.jpg' alt='John Doe'>",
3739
"url": "/user/view.php?id=1",

0 commit comments

Comments
 (0)