Skip to content

Commit

Permalink
Correct error when adding BCC and CC to recipients
Browse files Browse the repository at this point in the history
  • Loading branch information
gpassarelli committed Aug 17, 2016
1 parent 7ecdef1 commit 91b47c7
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion Mail/src/MailGateway.php
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,13 @@ protected function handleEmailRecipientsProperties($recipients) {
unset($recipients['bcc']);
}

$recipientsProperties['to'] = $recipients;
// Checks if $recipients is an array and has the option to send a CC copy.
if(is_array($recipients) && array_key_exists('to', $recipients)){
$recipientsProperties['to'] = $recipients['to'];
unset($recipients['to']);
} else {
$recipientsProperties['to'] = $recipients;
}

return $recipientsProperties;
}
Expand Down

0 comments on commit 91b47c7

Please sign in to comment.