From e34a190eeb9d2b3134192565921efbceeb86d00d Mon Sep 17 00:00:00 2001 From: hiboudev Date: Thu, 19 Jan 2023 13:10:21 -0500 Subject: [PATCH] Add PR #223 WireMail: Use 'fromName' from config --- wire/core/WireMail.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/wire/core/WireMail.php b/wire/core/WireMail.php index 20e78e3f..61a31113 100644 --- a/wire/core/WireMail.php +++ b/wire/core/WireMail.php @@ -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";