mirror of
https://github.com/processwire/processwire.git
synced 2025-08-16 11:44:42 +02:00
Update wireMail fallback from email settings with 2nd check in case 3rd party module made default blank, plus update auto-detect from email logic in ProcessForgotPassword so it can't override configured wireMail settings with config.adminEmail
This commit is contained in:
@@ -629,7 +629,10 @@ class WireMail extends WireData implements WireMailInterface {
|
|||||||
*/
|
*/
|
||||||
protected function renderMailHeader() {
|
protected function renderMailHeader() {
|
||||||
|
|
||||||
|
$settings = $this->wire()->config->wireMail;
|
||||||
$from = $this->from;
|
$from = $this->from;
|
||||||
|
|
||||||
|
if(!strlen($from) && !empty($settings['from'])) $from = $settings['from'];
|
||||||
if(!strlen($from)) $from = $this->wire('config')->adminEmail;
|
if(!strlen($from)) $from = $this->wire('config')->adminEmail;
|
||||||
if(!strlen($from)) $from = 'processwire@' . $this->wire('config')->httpHost;
|
if(!strlen($from)) $from = 'processwire@' . $this->wire('config')->httpHost;
|
||||||
|
|
||||||
|
@@ -939,6 +939,10 @@ class ProcessForgotPassword extends Process implements ConfigurableModule {
|
|||||||
*/
|
*/
|
||||||
protected function getEmailFrom() {
|
protected function getEmailFrom() {
|
||||||
$emailFrom = $this->emailFrom;
|
$emailFrom = $this->emailFrom;
|
||||||
|
if(empty($emailFrom)) {
|
||||||
|
$settings = $this->wire()->config->wireMail;
|
||||||
|
if(!empty($settings['from'])) $emailFrom = $settings['from'];
|
||||||
|
}
|
||||||
if(empty($emailFrom)) $emailFrom = $this->wire('config')->adminEmail;
|
if(empty($emailFrom)) $emailFrom = $this->wire('config')->adminEmail;
|
||||||
if(empty($emailFrom)) $emailFrom = 'noreply@' . $this->wire('config')->httpHost;
|
if(empty($emailFrom)) $emailFrom = 'noreply@' . $this->wire('config')->httpHost;
|
||||||
return $emailFrom;
|
return $emailFrom;
|
||||||
|
Reference in New Issue
Block a user