Skip to content
This repository has been archived by the owner on Jun 4, 2018. It is now read-only.

Commit

Permalink
- Fixes fromName not being read correctly that would always set the s…
Browse files Browse the repository at this point in the history
…ender name as 'ProcessWire'
  • Loading branch information
plauclair committed Mar 22, 2016
1 parent b8f9b07 commit 320c011
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions WireMailMailgun.module
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class WireMailMailgun extends WireMail implements Module, ConfigurableModule
{
return array(
'title' => 'WireMail Mailgun',
'version' => '0.4',
'version' => '0.4.1',
'summary' => "Mailgun for ProcessWire",
'href' => 'https://github.com/plauclair/WireMailMailgun',
'author' => 'plauclair',
Expand Down Expand Up @@ -462,12 +462,15 @@ class WireMailMailgun extends WireMail implements Module, ConfigurableModule
*/
private function getFrom()
{
$fromEmail = $this->fromEmail;
$fromName = $this->fromName;

if (!empty($this->mail['from'])) {
// Set manually
return (empty($this->mail['fromName'])) ? $this->mail['from'] : "{$this->mail['fromName']} <{$this->mail['from']}>";
} else if (!empty($this->fromEmail)) {
} else if (!empty($fromEmail)) {
// Set in settings
return (empty($this->fromName)) ? "ProcessWire <{$this->fromEmail}>" : "{$this->fromName} <{$this->fromEmail}>";
return (empty($fromName)) ? "ProcessWire <{$fromEmail}>" : "{$fromName} <{$fromEmail}>";
} else {
// Default
return "ProcessWire <processwire@{$this->domain}>";
Expand Down

0 comments on commit 320c011

Please sign in to comment.