Use 'cron_setup_user' when sending emails (#414)

This commit is contained in:
Mark Nelson 2021-06-13 14:04:18 +08:00
parent 768fb4f84e
commit bcba998a97
2 changed files with 4 additions and 0 deletions

View file

@ -15,6 +15,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). - Users being able to view the certificate before the required time set (#403).
- Fixed the issue with displaying PDF when debugging is ON (#420). - Fixed the issue with displaying PDF when debugging is ON (#420).
- Using incorrect context when sending emails (#402). - Using incorrect context when sending emails (#402).
- Use `cron_setup_user` when sending emails (#414).
## [3.8.5] - 2020-11-26 ## [3.8.5] - 2020-11-26

View file

@ -179,6 +179,9 @@ class email_certificate_task extends \core\task\scheduled_task {
// Now, email the people we need to. // Now, email the people we need to.
foreach ($issuedusers as $user) { foreach ($issuedusers as $user) {
// Set up the user.
cron_setup_user($user);
$userfullname = fullname($user); $userfullname = fullname($user);
$info->userfullname = $userfullname; $info->userfullname = $userfullname;