how to put site-name in mail sent to users ?

how to put site-name in mail sent to users ?

by Frederic Triquet -
Number of replies: 1
Hi,
I would like to put the name of my moodle-site in the subject of the mails sent to the users (so a filter on the mail client could put the message in a given subfolder).
How can I do this ?

Thanks in advance

Fred
Average of ratings: -
In reply to Frederic Triquet

Re: how to put site-name in mail sent to users ?

by Frederic Triquet -

Well,

I had some time to look into the code, could the following be the solution ?

in moodle/lib/moodlelib.php, function email_to_user, replace :

$mail->Subject = stripslashes($subject);

with

$site = get_site();
$mail->Subject = '['. $site->shortname .'] ' . stripslashes($subject);

Fred