Skip to content

Commit

Permalink
Switched to use an options array to allow future options
Browse files Browse the repository at this point in the history
  • Loading branch information
Beau West committed Mar 14, 2012
1 parent 6a8edc2 commit adc63b8
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions Postmark.php
Expand Up @@ -305,13 +305,16 @@ public function &replyTo($address, $name = null)
/**
* Sends the e-mail. Prints debug output if debug mode is turned on
*
* Options:
* returnMessageId
*
* @throws Exception If HTTP code 422, Exception with API error code and Postmark message, otherwise HTTP code.
* @throws BadMethodCallException If From address, To address or Subject is missing
* @return boolean - True if success and $returnID is false.
* @return string - if $returnID is true and one message is sent.
* @return array - if DEBUG_RETURN is enabled.
*/
public function send($returnId = false)
public function send($options = array())
{
$this->_validateData();
$data = $this->_prepareData();
Expand Down Expand Up @@ -374,7 +377,7 @@ public function send($returnId = false)
}

// Return the ID of the message sent if the option is set.
if($returnId) {
if(!empty($options['returnMessageId'])) {
$messageInformation = json_decode($return);
return $messageInformation->MessageID;
}
Expand Down

0 comments on commit adc63b8

Please sign in to comment.