Skip to content

Commit

Permalink
Merge pull request #19 from codyfletcher/master
Browse files Browse the repository at this point in the history
Added support for "bcc" as a type of processed object.
  • Loading branch information
tedivm committed Jul 28, 2013
2 parents 12f147b + 43263f9 commit 0000c11
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions src/Fetch/Message.php
Original file line number Diff line number Diff line change
Expand Up @@ -121,19 +121,26 @@ class Message
protected $from;

/**
* This is an array of arrays that contain information about the addresses the email was cc'd to.
* This is an array of arrays that contains information about the addresses the email was sent to.
*
* @var array
*/
protected $to;

/**
* This is an array of arrays that contain information about the addresses the email was cc'd to.
* This is an array of arrays that contains information about the addresses the email was cc'd to.
*
* @var array
*/
protected $cc;

/**
* This is an array of arrays that contains information about the addresses the email was bcc'd to.
*
* @var array
*/
protected $bcc;

/**
* This is an array of arrays that contain information about the addresses that should receive replies to the email.
*
Expand Down Expand Up @@ -200,6 +207,9 @@ protected function loadMessage()
if (isset($headers->cc))
$this->cc = $this->processAddressObject($headers->cc);

if (isset($headers->bcc))
$this->bcc = $this->processAddressObject($headers->bcc);

$this->from = $this->processAddressObject($headers->from);
$this->replyTo = isset($headers->reply_to) ? $this->processAddressObject($headers->reply_to) : $this->from;

Expand Down Expand Up @@ -316,13 +326,13 @@ public function getMessageBody($html = false)
* This function returns either an array of email addresses and names or, optionally, a string that can be used in
* mail headers.
*
* @param string $type Should be 'to', 'cc', 'from', or 'reply-to'.
* @param string $type Should be 'to', 'cc', 'bcc', 'from', or 'reply-to'.
* @param bool $asString
* @return array|string|bool
*/
public function getAddresses($type, $asString = false)
{
$addressTypes = array('to', 'cc', 'from', 'reply-to');
$addressTypes = array('to', 'cc', 'bcc', 'from', 'reply-to');

if (!in_array($type, $addressTypes) || !isset($this->$type) || count($this->$type) < 1)
return false;
Expand Down

0 comments on commit 0000c11

Please sign in to comment.