From d6da89a2db886b848122aec500d6a556726f5255 Mon Sep 17 00:00:00 2001 From: NauxLiu Date: Mon, 17 Apr 2017 10:26:32 +0800 Subject: [PATCH] Fix a bug while sending multi emails. fix #18 --- src/SendCloudTransport.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/SendCloudTransport.php b/src/SendCloudTransport.php index c40c2d7..fbc50a1 100644 --- a/src/SendCloudTransport.php +++ b/src/SendCloudTransport.php @@ -20,6 +20,9 @@ class SendCloudTransport extends Transport protected $query = []; + private $api_user; + private $api_key; + /** * SendCloudTransport constructor. * @@ -28,8 +31,8 @@ class SendCloudTransport extends Transport */ public function __construct($api_user, $api_key) { - $this->addQuery('api_user', $api_user); - $this->addQuery('api_key', $api_key); + $this->api_user = $api_user; + $this->api_key = $api_key; } /** @@ -45,6 +48,8 @@ public function __construct($api_user, $api_key) */ public function send(Swift_Mime_Message $message, &$failedRecipients = null) { + $this->addQuery('api_user', $this->api_user); + $this->addQuery('api_key', $this->api_key); $this->addQuery('subject', $message->getSubject()); $this->addQuery('from', $this->getAddress($message->getFrom())); $this->addQuery('fromname', $this->getFromName($message));