mirror of
https://github.com/fusionpbx/fusionpbx.git
synced 2025-12-30 00:53:50 +00:00
Email Queue - List: Add Resend option.
This commit is contained in:
@@ -81,6 +81,57 @@
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* resend emails in the queue
|
||||
*/
|
||||
public function resend($records) {
|
||||
if (permission_exists($this->name.'_edit')) {
|
||||
|
||||
//add multi-lingual support
|
||||
$language = new text;
|
||||
$text = $language->get();
|
||||
|
||||
//validate the token
|
||||
$token = new token;
|
||||
if (!$token->validate($_SERVER['PHP_SELF'])) {
|
||||
message::add($text['message-invalid_token'],'negative');
|
||||
header('Location: '.$this->location);
|
||||
exit;
|
||||
}
|
||||
|
||||
//resend multiple emails
|
||||
if (is_array($records) && @sizeof($records) != 0) {
|
||||
//build the message array
|
||||
$x = 0;
|
||||
foreach ($records as $record) {
|
||||
//add to the array
|
||||
if ($record['checked'] == 'true' && is_uuid($record['uuid'])) {
|
||||
$array[$this->table][$x][$this->name.'_uuid'] = $record['uuid'];
|
||||
$array[$this->table][$x]['email_status'] = 'waiting';
|
||||
$array[$this->table][$x]['email_retry_count'] = null;
|
||||
}
|
||||
|
||||
//increment the id
|
||||
$x++;
|
||||
}
|
||||
|
||||
//save the changes
|
||||
if (is_array($array) && @sizeof($array) != 0) {
|
||||
//save the array
|
||||
$database = new database;
|
||||
$database->app_name = $this->app_name;
|
||||
$database->app_uuid = $this->app_uuid;
|
||||
$database->save($array);
|
||||
unset($array);
|
||||
|
||||
//set message
|
||||
message::add($text['message-resending_messages']);
|
||||
}
|
||||
unset($records, $states);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* toggle a field between two values
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user