18f9cc2d by Marty Penner

Correct how emails are inserted into the mail daemon

1 parent 353cdaee
......@@ -269,12 +269,14 @@ function send_triggered_notification($uid = 0, $trigger = "NO_TRIGGER", $args =
);
$sentSuccessfully = false;
$sentTime = '';
if (CBV\system_can_send_emails()) {
$response = \wpMandrill::mail($to_email, $subject, !empty($html) ? $html : $alttext, [], $attachments);
if (isset($response['status']) && !in_array($response['status'], ['rejected', 'invalid'])) {
if (
isset($response[0]['status'])
&& isset($response[0]['status'])
&& !in_array($response['status'], ['rejected', 'invalid'])
) {
$sentSuccessfully = true;
$sentTime = current_time('mysql', 1);
}
}
......@@ -291,8 +293,7 @@ function send_triggered_notification($uid = 0, $trigger = "NO_TRIGGER", $args =
'attachment2' => $att2,
'attachment3' => $att3,
'sent' => (int)$sentSuccessfully,
'sent_date' => $sentTime,
'created' => current_time('mysql', 1)
'sent_date' => ''
],
[
'%d',
......