From dc2ce4f9efb831a304e1c2674aae1dfd819b9c56 Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Thu, 15 Dec 2016 09:01:54 -0600 Subject: [PATCH] formatting --- src/Illuminate/Mail/MailServiceProvider.php | 5 ++++- src/Illuminate/Mail/Mailer.php | 22 ++++++++++----------- 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/src/Illuminate/Mail/MailServiceProvider.php b/src/Illuminate/Mail/MailServiceProvider.php index 004f0f2117af..16f9b6882a75 100755 --- a/src/Illuminate/Mail/MailServiceProvider.php +++ b/src/Illuminate/Mail/MailServiceProvider.php @@ -48,7 +48,10 @@ public function register() $mailer->alwaysTo($to['address'], $to['name']); } - $replyTo = $app['config']['mail.reply-to']; + // If a "reply to" address is set, we will set it on the mailer so that each + // message sent by the application will utilize the same address for this + // setting. This is more convenient than specifying it on each message. + $replyTo = $app['config']['mail.reply_to']; if (is_array($replyTo) && isset($replyTo['address'])) { $mailer->alwaysReplyTo($replyTo['address'], $replyTo['name']); diff --git a/src/Illuminate/Mail/Mailer.php b/src/Illuminate/Mail/Mailer.php index 194ad4c1e4f3..155e3d59e9c3 100755 --- a/src/Illuminate/Mail/Mailer.php +++ b/src/Illuminate/Mail/Mailer.php @@ -46,18 +46,18 @@ class Mailer implements MailerContract, MailQueueContract protected $from; /** - * The global to address and name. + * The global reply-to address and name. * * @var array */ - protected $to; + protected $replyTo; /** - * The global reply-to address and name. + * The global to address and name. * * @var array */ - protected $replyTo; + protected $to; /** * The IoC container instance. @@ -108,27 +108,27 @@ public function alwaysFrom($address, $name = null) } /** - * Set the global to address and name. + * Set the global reply-to address and name. * * @param string $address * @param string|null $name * @return void */ - public function alwaysTo($address, $name = null) + public function alwaysReplyTo($address, $name = null) { - $this->to = compact('address', 'name'); + $this->replyTo = compact('address', 'name'); } /** - * Set the global reply-to address and name. + * Set the global to address and name. * * @param string $address * @param string|null $name * @return void */ - public function alwaysReplyTo($address, $name = null) + public function alwaysTo($address, $name = null) { - $this->replyTo = compact('address', 'name'); + $this->to = compact('address', 'name'); } /** @@ -436,7 +436,7 @@ protected function createMessage() $message->from($this->from['address'], $this->from['name']); } - // If a global reply-to address has been specified we will set it on every message + // When a global reply address was specified we will set this on every message // instances so the developer does not have to repeat themselves every time // they create a new message. We will just go ahead and push the address. if (! empty($this->replyTo['address'])) {