From 1f1b2f768908ef48f24b4f382eb6fe1175923b3c Mon Sep 17 00:00:00 2001 From: Mark Nelson Date: Sun, 20 Sep 2020 14:24:50 +0200 Subject: [PATCH] Do not email those who can manage the certificate (#376) --- classes/task/email_certificate_task.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/classes/task/email_certificate_task.php b/classes/task/email_certificate_task.php index d4efc93..846151f 100644 --- a/classes/task/email_certificate_task.php +++ b/classes/task/email_certificate_task.php @@ -112,6 +112,11 @@ class email_certificate_task extends \core\task\scheduled_task { continue; } + // Don't want to email those with the capability to manage the certificate. + if (has_capability('mod/customcert:manage', $context, $enroluser->id)) { + continue; + } + // Only email those with the capability to receive the certificate. if (!has_capability('mod/customcert:receiveissue', $context, $enroluser->id)) { continue;