1
0
mirror of https://github.com/moodle/moodle.git synced 2025-04-24 09:55:33 +02:00

Merge branch 'MDL-81629-main' of https://github.com/NJahreis/moodle

This commit is contained in:
Huong Nguyen 2024-08-15 10:06:29 +07:00
commit 482ef20399
No known key found for this signature in database
GPG Key ID: 40D88AB693A3E72A

@ -57,7 +57,16 @@ if ($form->is_cancelled()) {
$data->notloggedinuser = (!$user);
$message = $renderer->render_from_template('user/contact_site_support_email_body', $data);
if (!email_to_user(core_user::get_support_user(), $from, $subject, $message)) {
$sendmail = email_to_user(
user: core_user::get_support_user(),
from: $from,
subject: $subject,
messagetext: $message,
usetrueaddress: true,
replyto: $data->email,
replytoname: $data->name
);
if (!$sendmail) {
$supportemail = $CFG->supportemail;
$form->set_data($data);
$templatectx = [