Set proper context when sending emails (#402)
This commit is contained in:
parent
bd361d2434
commit
11225ff1fa
|
@ -9,7 +9,7 @@ Note - All hash comments refer to the issue number. Eg. #169 refers to https://g
|
||||||
### Fixed
|
### Fixed
|
||||||
- Usage of deprecated functions (#423)
|
- Usage of deprecated functions (#423)
|
||||||
|
|
||||||
## [3.10.1] - 2021-XX-YY
|
## [3.10.1] - 2021-06-13
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
- Usage of github actions (#407).
|
- Usage of github actions (#407).
|
||||||
|
@ -20,6 +20,7 @@ Note - All hash comments refer to the issue number. Eg. #169 refers to https://g
|
||||||
- Managers are now able to download their students' certificates (#412).
|
- Managers are now able to download their students' certificates (#412).
|
||||||
- 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).
|
||||||
|
|
||||||
## [3.8.5] - 2020-11-26
|
## [3.8.5] - 2020-11-26
|
||||||
|
|
||||||
|
|
|
@ -86,6 +86,9 @@ class email_certificate_task extends \core\task\scheduled_task {
|
||||||
// Get the context.
|
// Get the context.
|
||||||
$context = \context::instance_by_id($customcert->contextid);
|
$context = \context::instance_by_id($customcert->contextid);
|
||||||
|
|
||||||
|
// Set the $PAGE context - this ensure settings, such as language, are kept and don't default to the site settings.
|
||||||
|
$PAGE->set_context($context);
|
||||||
|
|
||||||
// Get the person we are going to send this email on behalf of.
|
// Get the person we are going to send this email on behalf of.
|
||||||
$userfrom = \core_user::get_noreply_user();
|
$userfrom = \core_user::get_noreply_user();
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue