Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Email subject for pending orders expiring.

  • Loading branch information...
commit 52425959755ff22c733bc39b7580166f848e2e2a 1 parent 2605a5b
ethem authored
15 enrol/authorize/enrol.php
@@ -656,16 +656,21 @@ function cron()
656 656 $a = new stdClass;
657 657 $a->pending = $count;
658 658 $a->days = $CFG->an_emailexpired;
  659 + $subject = get_string('pendingorderssubject', 'enrol_authorize', $a);
  660 + $a = new stdClass;
  661 + $a->pending = $count;
  662 + $a->days = $CFG->an_emailexpired;
659 663 $a->enrolurl = "$CFG->wwwroot/$CFG->admin/users.php";
660 664 $a->url = $CFG->wwwroot."/enrol/authorize/index.php?status=".AN_STATUS_AUTH;
661 665 $message = get_string('pendingordersemail', 'enrol_authorize', $a);
662 666 $adminuser = get_admin();
663   - email_to_user($adminuser, $adminuser, "WARNING: PENDING PAYMENTS", $message);
  667 + email_to_user($adminuser, $adminuser, $subject, $message);
664 668 if (!empty($CFG->an_teachermanagepay) and !empty($CFG->an_emailexpiredteacher)) {
665 669 $sql = "SELECT DISTINCT E.courseid, COUNT(E.courseid) AS count " .
666 670 "FROM {$CFG->prefix}enrol_authorize E " .
667 671 "WHERE $select GROUP BY E.courseid";
668   - $message = ''; $lastcourse = 0; $lastcount = 0;
  672 + $message = ''; $subject = '';
  673 + $lastcourse = 0; $lastcount = 0;
669 674 $courseidandcounts = get_records_sql($sql);
670 675 foreach($courseidandcounts as $courseidandcount) {
671 676 if ($lastcourse != $courseidandcount->courseid) {
@@ -674,6 +679,10 @@ function cron()
674 679 $a = new stdClass;
675 680 $a->pending = $lastcount;
676 681 $a->days = $CFG->an_emailexpired;
  682 + $subject = get_string('pendingorderssubject', 'enrol_authorize', $a);
  683 + $a = new stdClass;
  684 + $a->pending = $lastcount;
  685 + $a->days = $CFG->an_emailexpired;
677 686 $a->enrolurl = "$CFG->wwwroot/$CFG->admin/users.php";
678 687 $a->url = $CFG->wwwroot.'/enrol/authorize/index.php?course='.
679 688 $lastcourse.'&status='.AN_STATUS_AUTH;
@@ -681,7 +690,7 @@ function cron()
681 690 }
682 691 if ($teachers = get_course_teachers($lastcourse)) {
683 692 foreach ($teachers as $teacher) {
684   - email_to_user($teacher, $adminuser, "WARNING: PENDING PAYMENTS", $message);
  693 + email_to_user($teacher, $adminuser, $subject, $message);
685 694 }
686 695 }
687 696 }
3  lang/en_utf8/enrol_authorize.php
@@ -96,7 +96,7 @@
96 96 $string['paymentpending'] = 'Your payment is pending for this course with this order number $a->orderid. See <a href=\'$a->url\'>Order Details</a>.';
97 97 $string['pendingordersemail'] = 'Dear admin/teacher,
98 98
99   -$a->pending transactions will be expired unless you accept payment with in $a->days days.
  99 +$a->pending transactions will expire unless you accept payment with in $a->days days.
100 100
101 101 This is a warning message, because you didn\'t enable scheduled-capture. It means you have to accept or deny payments manually.
102 102
@@ -106,6 +106,7 @@
106 106 To enable scheduled-capture (for admins only), it means you will not receive any warning emails anymore, go to:
107 107
108 108 $a->enrolurl';
  109 +$string['pendingorderssubject'] = 'WARNING: $a->pending order(s) will expire within $a->days day(s).'
109 110 $string['reason11'] = 'A duplicate transaction has been submitted.';
110 111 $string['reason13'] = 'The merchant Login ID is invalid or the account is inactive.';
111 112 $string['reason16'] = 'The transaction was not found.';

0 comments on commit 5242595

Please sign in to comment.
Something went wrong with that request. Please try again.