0374f83c by Marty Penner

Ensure that Mandrill mail responses are checked if they are arrays

1 parent 2d6a8eb0
...@@ -271,7 +271,8 @@ function send_triggered_notification($uid = 0, $trigger = "NO_TRIGGER", $args = ...@@ -271,7 +271,8 @@ function send_triggered_notification($uid = 0, $trigger = "NO_TRIGGER", $args =
271 if (CBV\system_can_send_emails()) { 271 if (CBV\system_can_send_emails()) {
272 $response = \wpMandrill::mail($to_email, $subject, !empty($html) ? $html : $alttext, [], $attachments); 272 $response = \wpMandrill::mail($to_email, $subject, !empty($html) ? $html : $alttext, [], $attachments);
273 if ( 273 if (
274 isset($response[0]['status']) 274 is_array($response)
275 && isset($response[0]['status'])
275 && isset($response[0]['status']) 276 && isset($response[0]['status'])
276 && !in_array($response['status'], ['rejected', 'invalid']) 277 && !in_array($response['status'], ['rejected', 'invalid'])
277 ) { 278 ) {
......