diff --git a/enrol/authorize/enrol.php b/enrol/authorize/enrol.php index 065f0f747cc..ba7dd9fed55 100755 --- a/enrol/authorize/enrol.php +++ b/enrol/authorize/enrol.php @@ -653,6 +653,10 @@ class enrolment_plugin_authorize $timediffem = $timenowsettle - ((30 - intval($CFG->an_emailexpired)) * $oneday); $select = "(status='". AN_STATUS_AUTH ."') AND (timecreated<'$timediffem') AND (timecreated>'$timediff30')"; if ($count = count_records_select('enrol_authorize', $select)) { + $a = new stdClass; + $a->pending = $count; + $a->days = $CFG->an_emailexpired; + $subject = get_string('pendingorderssubject', 'enrol_authorize', $a); $a = new stdClass; $a->pending = $count; $a->days = $CFG->an_emailexpired; @@ -660,12 +664,13 @@ class enrolment_plugin_authorize $a->url = $CFG->wwwroot."/enrol/authorize/index.php?status=".AN_STATUS_AUTH; $message = get_string('pendingordersemail', 'enrol_authorize', $a); $adminuser = get_admin(); - email_to_user($adminuser, $adminuser, "WARNING: PENDING PAYMENTS", $message); + email_to_user($adminuser, $adminuser, $subject, $message); if (!empty($CFG->an_teachermanagepay) and !empty($CFG->an_emailexpiredteacher)) { $sql = "SELECT DISTINCT E.courseid, COUNT(E.courseid) AS count " . "FROM {$CFG->prefix}enrol_authorize E " . "WHERE $select GROUP BY E.courseid"; - $message = ''; $lastcourse = 0; $lastcount = 0; + $message = ''; $subject = ''; + $lastcourse = 0; $lastcount = 0; $courseidandcounts = get_records_sql($sql); foreach($courseidandcounts as $courseidandcount) { if ($lastcourse != $courseidandcount->courseid) { @@ -674,6 +679,10 @@ class enrolment_plugin_authorize $a = new stdClass; $a->pending = $lastcount; $a->days = $CFG->an_emailexpired; + $subject = get_string('pendingorderssubject', 'enrol_authorize', $a); + $a = new stdClass; + $a->pending = $lastcount; + $a->days = $CFG->an_emailexpired; $a->enrolurl = "$CFG->wwwroot/$CFG->admin/users.php"; $a->url = $CFG->wwwroot.'/enrol/authorize/index.php?course='. $lastcourse.'&status='.AN_STATUS_AUTH; @@ -681,7 +690,7 @@ class enrolment_plugin_authorize } if ($teachers = get_course_teachers($lastcourse)) { foreach ($teachers as $teacher) { - email_to_user($teacher, $adminuser, "WARNING: PENDING PAYMENTS", $message); + email_to_user($teacher, $adminuser, $subject, $message); } } } diff --git a/lang/en_utf8/enrol_authorize.php b/lang/en_utf8/enrol_authorize.php index edda017d98f..f6000c33e8a 100644 --- a/lang/en_utf8/enrol_authorize.php +++ b/lang/en_utf8/enrol_authorize.php @@ -96,7 +96,7 @@ $string['paymentmanagement'] = 'Payment Management'; $string['paymentpending'] = 'Your payment is pending for this course with this order number $a->orderid. See url\'>Order Details.'; $string['pendingordersemail'] = 'Dear admin/teacher, -$a->pending transactions will be expired unless you accept payment with in $a->days days. +$a->pending transactions will expire unless you accept payment with in $a->days days. This is a warning message, because you didn\'t enable scheduled-capture. It means you have to accept or deny payments manually. @@ -106,6 +106,7 @@ $a->url To enable scheduled-capture (for admins only), it means you will not receive any warning emails anymore, go to: $a->enrolurl'; +$string['pendingorderssubject'] = 'WARNING: $a->pending order(s) will expire within $a->days day(s).' $string['reason11'] = 'A duplicate transaction has been submitted.'; $string['reason13'] = 'The merchant Login ID is invalid or the account is inactive.'; $string['reason16'] = 'The transaction was not found.';