Update email_logs.php

This commit is contained in:
FusionPBX 2022-04-17 14:16:29 -06:00 committed by GitHub
parent 8c84c9c837
commit e80a04f1a5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 15 additions and 16 deletions

View File

@ -147,42 +147,41 @@ if (!class_exists('email_logs')) {
$sql .= "where email_log_uuid = :email_log_uuid "; $sql .= "where email_log_uuid = :email_log_uuid ";
$parameters['email_log_uuid'] = $uuid; $parameters['email_log_uuid'] = $uuid;
$database = new database; $database = new database;
$email = $database->select($sql, $parameters, 'column'); $msg = $database->select($sql, $parameters, 'column');
$found = $email != '' ? true : false; $found = $msg != '' ? true : false;
unset($sql, $parameters, $row); unset($sql, $parameters, $row);
//resend email //resend email
if ($found) { if ($found) {
$msg = $email;
$resend = true; $resend = true;
require "secure/v_mailto.php"; require "secure/v_mailto.php";
if ($mailer_error == '') {
if ($sent) {
//build the delete array //build the delete array
$array[$this->table][$x][$this->uuid_prefix.'uuid'] = $uuid; $array[$this->table][$x][$this->uuid_prefix.'uuid'] = $uuid;
//grant temporary permissions //grant temporary permissions
$p = new permissions; $p = new permissions;
$p->add('email_log_delete', 'temp'); $p->add('email_log_delete', 'temp');
//delete the email log //delete the email log
$database = new database; $database = new database;
$database->app_name = $this->app_name; $database->app_name = $this->app_name;
$database->app_uuid = $this->app_uuid; $database->app_uuid = $this->app_uuid;
$database->delete($array); $database->delete($array);
unset($array); unset($array);
//revoke temporary permissions //revoke temporary permissions
$p->delete('email_log_delete', 'temp'); $p->delete('email_log_delete', 'temp');
//set message //set message
message::add($text['message-message_resent']); message::add($text['message-message_resent']);
} }
else { else {
//set message //set message
message::add($text['message-resend_failed'].": ".$mailer_error, 'negative', 4000); message::add($text['message-resend_failed'].": ".$email->email_error, 'negative', 4000);
} }
} }