1
0
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:
hiboudev
2023-01-19 13:10:21 -05:00
committed by Ryan Cramer
parent e0af32189e
commit e34a190eeb

View File

@@ -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";