From 03d56eddaea30819c7e63919ad1deb19c4252fd4 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;