Skip to content

Commit

Permalink
Merge pull request #12 from portrino/master
Browse files Browse the repository at this point in the history
* [TASK] Changes dependancy for codeception-email back to ^1.0
  • Loading branch information
ericmartel authored Sep 15, 2017
2 parents b6043cd + de93863 commit 9762a21
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
}
],
"require": {
"ericmartel/codeception-email": "dev-master",
"ericmartel/codeception-email": "^1.0",
"guzzlehttp/guzzle": "^6.1"
},
"autoload": {
Expand Down
21 changes: 11 additions & 10 deletions src/MailHog.php
Original file line number Diff line number Diff line change
Expand Up @@ -143,19 +143,20 @@ public function fetchEmails()
public function accessInboxFor($address)
{
$inbox = array();

foreach($this->fetchedEmails as $email)
{
if(!isset($email->Content->Headers->Bcc))
{
if(strpos($email->Content->Headers->To[0], $address) !== FALSE || (isset($email->Content->Headers->Cc) && array_search($address, $email->Content->Headers->Cc)))
{
array_push($inbox, $email);
if (strpos($email->Content->Headers->To[0], $address) !== false) {
array_push($inbox, $email);
}

if (isset($email->Content->Headers->Cc) && array_search($address, $email->Content->Headers->Cc)) {
array_push($inbox, $email);
}

if (isset($email->Content->Headers->Bcc) && array_search($address, $email->Content->Headers->Bcc)) {
array_push($inbox, $email);
}
}
else if(strpos($email->Content->Headers->Bcc[0], $address) !== FALSE)
{
array_push($inbox, $email);
}
}
$this->setCurrentInbox($inbox);
}
Expand Down

0 comments on commit 9762a21

Please sign in to comment.