Skip to content

Commit c3dadc6

Browse files
committed
Merge pull request #44 from bnrmth/master
Allow empty default sender_name as it is optional in Mandrill Messages
2 parents 8c23d00 + 0ce0990 commit c3dadc6

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

DependencyInjection/Configuration.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public function getConfigTreeBuilder()
5151
->isRequired()
5252
->children()
5353
->scalarNode('sender')->isRequired()->cannotBeEmpty()->end()
54-
->scalarNode('sender_name')->isRequired()->cannotBeEmpty()->end()
54+
->scalarNode('sender_name')->defaultNull()->end()
5555
->scalarNode('subaccount')->defaultNull()->end()
5656
->end()
5757
->end()

Dispatcher.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ public function send(Message $message, $templateName = '', $templateContent = ar
109109
$message->setFromEmail($this->defaultSender);
110110
}
111111

112-
if (strlen($message->getFromName()) == 0) {
112+
if (strlen($message->getFromName()) == 0 && null !== $this->defaultSenderName) {
113113
$message->setFromName($this->defaultSenderName);
114114
}
115115

@@ -144,11 +144,11 @@ private function addCurlProxyOptions()
144144
if ($this->proxy['host'] !== null) {
145145
curl_setopt($this->service->ch, CURLOPT_PROXY, $this->proxy['host']);
146146
}
147-
147+
148148
if ($this->proxy['port'] !== null) {
149149
curl_setopt($this->service->ch, CURLOPT_PROXYPORT, $this->proxy['port']);
150150
}
151-
151+
152152
if ($this->proxy['user'] !== null && $this->proxy['password'] !== null) {
153153
curl_setopt($this->service->ch, CURLOPT_PROXYUSERPWD, sprintf(
154154
'%s:%s',

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ hip_mandrill:
7373
debug: true
7474
default:
7575
76-
sender_name: John Doe
76+
sender_name: John Doe # Optionally define a sender name (from name)
7777
subaccount: Project # Optionally define a subaccount to use
7878
proxy:
7979
use: true # when you are behing a proxy. Default value is 'false'

0 commit comments

Comments
 (0)