mirror of
https://github.com/processwire/processwire.git
synced 2025-08-11 09:14:58 +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;
|
||||
$settings = $config->wireMail;
|
||||
$from = $this->from;
|
||||
$fromName = $this->fromName;
|
||||
|
||||
if(!strlen($from) && !empty($settings['from'])) $from = $settings['from'];
|
||||
if(!strlen($from)) $from = $config->adminEmail;
|
||||
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) {
|
||||
$header .= "\r\n$key: $value";
|
||||
|
Reference in New Issue
Block a user