From 9d9102ada5de1178e6c3f6090e0c2b5f8d5f111a Mon Sep 17 00:00:00 2001 From: lainme Date: Wed, 4 Mar 2015 13:54:04 +0800 Subject: [PATCH] send email as site supporter --- lib.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib.php b/lib.php index 30be04c..ddb8c73 100644 --- a/lib.php +++ b/lib.php @@ -206,7 +206,7 @@ function sendCancelMail($info){ $replace = array('firstname'=>$info->firstname,'content'=>format_string($info->coursename),'lastname'=>$info->lastname,'username'=>$info->username); $body = $apply_setting['cancelmailcontent']->value; $body = updateMailContent($body,$replace); - $contact = get_admin(); + $contact = core_user::get_support_user(); email_to_user($info, $contact, $apply_setting['cancelmailsubject']->value, html_to_text($body), $body); } @@ -218,7 +218,7 @@ function sendConfirmMail($info){ $replace = array('firstname'=>$info->firstname,'content'=>format_string($info->coursename),'lastname'=>$info->lastname,'username'=>$info->username); $body = $apply_setting['confirmmailcontent']->value; $body = updateMailContent($body,$replace); - $contact = get_admin(); + $contact = core_user::get_support_user(); email_to_user($info, $contact, $apply_setting['confirmmailsubject']->value, html_to_text($body), $body); } @@ -239,7 +239,7 @@ function sendConfirmMailToTeachers($courseid,$instanceid,$desc){ $body .= '

'. get_string('applyuser', 'enrol_apply') .': '.$USER->firstname.' '.$USER->lastname.'

'; $body .= '

'. get_string('comment', 'enrol_apply') .': '.$desc.'

'; $body .= '

'. html_writer::link(new moodle_url("/enrol/apply/apply.php", array('id'=>$courseid,'enrolid'=>$instanceid)), get_string('applymanage', 'enrol_apply')).'

'; - $contact = get_admin(); + $contact = core_user::get_support_user(); $info = $editTeacher; $info->coursename = $course->fullname; email_to_user($info, $contact, get_string('mailtoteacher_suject', 'enrol_apply'), html_to_text($body), $body); @@ -264,7 +264,7 @@ function sendConfirmMailToManagers($courseid,$desc){ $body .= '

'. get_string('applyuser', 'enrol_apply') .': '.$USER->firstname.' '.$USER->lastname.'

'; $body .= '

'. get_string('comment', 'enrol_apply') .': '.$desc.'

'; $body .= '

'. html_writer::link(new moodle_url('/enrol/apply/manage.php'), get_string('applymanage', 'enrol_apply')).'

'; - $contact = get_admin(); + $contact = core_user::get_support_user(); $info = $userWithManagerRole; $info->coursename = $course->fullname; email_to_user($info, $contact, get_string('mailtoteacher_suject', 'enrol_apply'), html_to_text($body), $body);