mirror of
https://github.com/processwire/processwire.git
synced 2025-08-10 08:44:46 +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,10 +629,13 @@ class WireMail extends WireData implements WireMailInterface {
|
||||
*/
|
||||
protected function renderMailHeader() {
|
||||
|
||||
$settings = $this->wire()->config->wireMail;
|
||||
$from = $this->from;
|
||||
|
||||
if(!strlen($from) && !empty($settings['from'])) $from = $settings['from'];
|
||||
if(!strlen($from)) $from = $this->wire('config')->adminEmail;
|
||||
if(!strlen($from)) $from = 'processwire@' . $this->wire('config')->httpHost;
|
||||
|
||||
|
||||
$header = "From: " . ($this->fromName ? $this->bundleEmailAndName($from, $this->fromName) : $from);
|
||||
|
||||
foreach($this->header as $key => $value) {
|
||||
|
@@ -939,6 +939,10 @@ class ProcessForgotPassword extends Process implements ConfigurableModule {
|
||||
*/
|
||||
protected function getEmailFrom() {
|
||||
$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 = 'noreply@' . $this->wire('config')->httpHost;
|
||||
return $emailFrom;
|
||||
|
Reference in New Issue
Block a user