[Mailer] fixed undefined index when sending mail
When a Mandrill API request is succesful, it returns an array of results, one for each recipient. To get rid of the undefined index error, we grab the message ID from the first recipient in the array.
This commit is contained in:
parent
a656a57736
commit
ef0aa4dc87
@ -57,7 +57,8 @@ class MandrillApiTransport extends AbstractApiTransport
|
||||
throw new HttpTransportException(sprintf('Unable to send an email (code %s).', $result['code']), $response);
|
||||
}
|
||||
|
||||
$sentMessage->setMessageId($result['_id']);
|
||||
$firstRecipient = reset($result);
|
||||
$sentMessage->setMessageId($firstRecipient['_id']);
|
||||
|
||||
return $response;
|
||||
}
|
||||
|
Reference in New Issue
Block a user