diff options
author | Stefan Giehl <stefan@matomo.org> | 2021-01-12 05:08:44 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-12 05:08:44 +0300 |
commit | 0d979429d6f5eeaaef87dd9a6ea7d2bf4bace769 (patch) | |
tree | 7844b4f7d45fd641b8f06004d4acb293cf91108b /plugins/Login | |
parent | 906814db3f8d9ef660db7792c6679b6b76ffccdd (diff) |
Use confiugred noreply mail address when sending recovery mails (#17072)
Diffstat (limited to 'plugins/Login')
-rw-r--r-- | plugins/Login/PasswordResetter.php | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/plugins/Login/PasswordResetter.php b/plugins/Login/PasswordResetter.php index 9c706440f9..b71b846a1b 100644 --- a/plugins/Login/PasswordResetter.php +++ b/plugins/Login/PasswordResetter.php @@ -89,7 +89,7 @@ class PasswordResetter /** * The name to use in the From: part of the confirm password reset email. * - * Defaults to the `[General] login_password_recovery_email_name` INI config option. + * Defaults to the `[General] noreply_email_name` INI config option. * * @var string */ @@ -98,7 +98,7 @@ class PasswordResetter /** * The from email to use in the confirm password reset email. * - * Defaults to the `[General] login_password_recovery_email_address` INI config option. + * Defaults to the `[General] noreply_email_address` INI config option. * * @var */ @@ -130,14 +130,7 @@ class PasswordResetter $this->confirmPasswordAction = $confirmPasswordAction; } - if (empty($emailFromName)) { - $emailFromName = Config::getInstance()->General['login_password_recovery_email_name']; - } $this->emailFromName = $emailFromName; - - if (empty($emailFromAddress)) { - $emailFromAddress = Config::getInstance()->General['login_password_recovery_email_address']; - } $this->emailFromAddress = $emailFromAddress; if (empty($passwordHelper)) { @@ -457,7 +450,11 @@ class PasswordResetter ) . "</p>"; $mail->setWrappedHtmlBody($bodyText); - $mail->setFrom($this->emailFromAddress, $this->emailFromName); + if ($this->emailFromAddress || $this->emailFromName) { + $mail->setFrom($this->emailFromAddress, $this->emailFromName); + } else { + $mail->setDefaultFromPiwik(); + } $replytoEmailName = Config::getInstance()->General['login_password_recovery_replyto_email_name']; $replytoEmailAddress = Config::getInstance()->General['login_password_recovery_replyto_email_address']; |