From a20a5e168ca705d9b8124eca3d6ef219df1edbd8 Mon Sep 17 00:00:00 2001 From: Oliver Nassar Date: Wed, 7 Jan 2015 15:08:00 -0500 Subject: [PATCH] Added reset method To preserve memory, it's useful to reuse a Mail reference However doing so can cause recipients to spill over eg. when using the `addTo` method, any previously added recipients would continue to be sent the next piece of mail Adding the ability to reset these arrays makes the process easier --- src/Postmark/Mail.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/Postmark/Mail.php b/src/Postmark/Mail.php index dd3b89b..340292e 100755 --- a/src/Postmark/Mail.php +++ b/src/Postmark/Mail.php @@ -364,6 +364,20 @@ public function send($options = array()) return true; } + /** + * Resets recipients for an email to allow this reference to be used more + * than once + * + * @param string $subject E-mail subject + * @return Mail + */ + public function reset() + { + $this->_to = array(); + $this->_cc = array(); + $this->_bcc = array(); + } + /** * Specify subject *