Set proper context when sending emails (#402)
This commit is contained in:
parent
f5afd08bf4
commit
7a45c41cd9
2 changed files with 5 additions and 1 deletions
|
@ -84,6 +84,9 @@ class email_certificate_task extends \core\task\scheduled_task {
|
|||
// Get the context.
|
||||
$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.
|
||||
$userfrom = \core_user::get_noreply_user();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue