From 6ce7f1fd4539a04573b410ddb9ffa83731f26ec2 Mon Sep 17 00:00:00 2001 From: Mark Nelson Date: Sun, 13 Jun 2021 14:04:18 +0800 Subject: [PATCH] Use 'cron_setup_user' when sending emails (#414) --- CHANGES.md | 1 + classes/task/email_certificate_task.php | 3 +++ 2 files changed, 4 insertions(+) diff --git a/CHANGES.md b/CHANGES.md index 6d86f1f..edd3186 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -16,6 +16,7 @@ Note - All hash comments refer to the issue number. Eg. #169 refers to https://g - Users being able to view the certificate before the required time set (#403). - Fixed the issue with displaying PDF when debugging is ON (#420). - Using incorrect context when sending emails (#402). +- Use `cron_setup_user` when sending emails (#414). ## [3.8.5] - 2020-11-26 diff --git a/classes/task/email_certificate_task.php b/classes/task/email_certificate_task.php index e0906dd..a4ac712 100644 --- a/classes/task/email_certificate_task.php +++ b/classes/task/email_certificate_task.php @@ -179,6 +179,9 @@ class email_certificate_task extends \core\task\scheduled_task { // Now, email the people we need to. foreach ($issuedusers as $user) { + // Set up the user. + cron_setup_user($user); + $userfullname = fullname($user); $info->userfullname = $userfullname;