mirror of
https://github.com/moodle/moodle.git
synced 2025-01-19 14:27:22 +01:00
If review enabled, get_users_by_capability('enrol/authorize:managepayments') at SYSTEM_LEVEL and send email for a new pending payment.
This commit is contained in:
parent
70b1aa8071
commit
98d415567c
@ -227,7 +227,7 @@ class enrolment_plugin_authorize
|
||||
return;
|
||||
}
|
||||
|
||||
if ($an_review) { // review enabled, inform admin and redirect user to main page.
|
||||
if ($an_review) { // review enabled, inform site payment managers and redirect the user who have paid to main page.
|
||||
$a = new stdClass;
|
||||
$a->url = "$CFG->wwwroot/enrol/authorize/index.php?order=$order->id";
|
||||
$a->orderid = $order->id;
|
||||
@ -243,9 +243,11 @@ class enrolment_plugin_authorize
|
||||
$a->course = $course->shortname;
|
||||
$a->orderid = $order->id;
|
||||
$emailsubject = get_string('adminnewordersubject', 'enrol_authorize', $a);
|
||||
$admins = get_admins();
|
||||
foreach ($admins as $admin) {
|
||||
email_to_user($admin, $USER, $emailsubject, $emailmessage);
|
||||
$context = get_context_instance(CONTEXT_SYSTEM, SITEID);
|
||||
if ($sitepaymentmanagers = get_users_by_capability($context, 'enrol/authorize:managepayments')) {
|
||||
foreach ($sitepaymentmanagers as $sitepaymentmanager) {
|
||||
email_to_user($sitepaymentmanager, $USER, $emailsubject, $emailmessage);
|
||||
}
|
||||
}
|
||||
redirect($CFG->wwwroot, get_string("reviewnotify", "enrol_authorize"), '30');
|
||||
return;
|
||||
|
Loading…
x
Reference in New Issue
Block a user