Línea 55... |
Línea 55... |
55 |
$from = $user ?? core_user::get_noreply_user();
|
55 |
$from = $user ?? core_user::get_noreply_user();
|
56 |
$subject = get_string('supportemailsubject', 'admin', format_string($SITE->fullname));
|
56 |
$subject = get_string('supportemailsubject', 'admin', format_string($SITE->fullname));
|
57 |
$data->notloggedinuser = (!$user);
|
57 |
$data->notloggedinuser = (!$user);
|
58 |
$message = $renderer->render_from_template('user/contact_site_support_email_body', $data);
|
58 |
$message = $renderer->render_from_template('user/contact_site_support_email_body', $data);
|
Línea -... |
Línea 59... |
- |
|
59 |
|
59 |
|
60 |
$sendmail = email_to_user(
|
- |
|
61 |
user: core_user::get_support_user(),
|
- |
|
62 |
from: $from,
|
- |
|
63 |
subject: $subject,
|
- |
|
64 |
messagetext: $message,
|
- |
|
65 |
usetrueaddress: true,
|
- |
|
66 |
replyto: $data->email,
|
- |
|
67 |
replytoname: $data->name
|
- |
|
68 |
);
|
60 |
if (!email_to_user(core_user::get_support_user(), $from, $subject, $message)) {
|
69 |
if (!$sendmail) {
|
61 |
$supportemail = $CFG->supportemail;
|
70 |
$supportemail = $CFG->supportemail;
|
62 |
$form->set_data($data);
|
71 |
$form->set_data($data);
|
63 |
$templatectx = [
|
72 |
$templatectx = [
|
64 |
'supportemail' => $user ? html_writer::link("mailto:{$supportemail}", $supportemail) : false,
|
73 |
'supportemail' => $user ? html_writer::link("mailto:{$supportemail}", $supportemail) : false,
|