Add the email error

Log the email error to identify what went wrong with the email.
This commit is contained in:
FusionPBX 2023-02-13 13:03:04 -07:00 committed by GitHub
parent 8396f1b572
commit 7bca5305ec
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 7 deletions

View File

@ -302,11 +302,11 @@
$email->body = $email_body;
$email->attachments = $email_attachments;
$email->method = 'direct';
$sent = $email->send();
//$response = $email->email_error;
$email_response = $email->send();
$email_error = $email->email_error;
//send the email
if ($sent) {
if ($email_response) {
//set the email status to sent
$sql = "update v_email_queue ";
@ -437,15 +437,13 @@
else {
$sql .= "set email_status = 'trying', ";
}
$sql .= "email_debug = :email_debug, ";
$sql .= "email_retry_count = :email_retry_count, ";
$sql .= "update_date = now() ";
//$sql .= ", email_debug = :email_debug ";
$sql .= "where email_queue_uuid = :email_queue_uuid; ";
$parameters['email_queue_uuid'] = $email_queue_uuid;
//$parameters['email_debug'] = $mailer_error;
$parameters['email_debug'] = $mailer_error;
$parameters['email_retry_count'] = $email_retry_count;
//echo $sql."\n";
//print_r($parameters);
$database = new database;
$database->execute($sql, $parameters);
unset($parameters);