mirror of
https://github.com/processwire/processwire.git
synced 2025-08-12 01:34:31 +02:00
Add PR #223 WireMail: Use 'fromName' from config
This commit is contained in:
@@ -634,12 +634,14 @@ class WireMail extends WireData implements WireMailInterface {
|
|||||||
$config = $this->wire()->config;
|
$config = $this->wire()->config;
|
||||||
$settings = $config->wireMail;
|
$settings = $config->wireMail;
|
||||||
$from = $this->from;
|
$from = $this->from;
|
||||||
|
$fromName = $this->fromName;
|
||||||
|
|
||||||
if(!strlen($from) && !empty($settings['from'])) $from = $settings['from'];
|
if(!strlen($from) && !empty($settings['from'])) $from = $settings['from'];
|
||||||
if(!strlen($from)) $from = $config->adminEmail;
|
if(!strlen($from)) $from = $config->adminEmail;
|
||||||
if(!strlen($from)) $from = 'processwire@' . $config->httpHost;
|
if(!strlen($from)) $from = 'processwire@' . $config->httpHost;
|
||||||
|
if(!strlen($fromName) && !empty($settings['fromName'])) $fromName = $settings['fromName'];
|
||||||
|
|
||||||
$header = "From: " . ($this->fromName ? $this->bundleEmailAndName($from, $this->fromName) : $from);
|
$header = "From: " . ($fromName ? $this->bundleEmailAndName($from, $fromName) : $from);
|
||||||
|
|
||||||
foreach($this->header as $key => $value) {
|
foreach($this->header as $key => $value) {
|
||||||
$header .= "\r\n$key: $value";
|
$header .= "\r\n$key: $value";
|
||||||
|
Reference in New Issue
Block a user