|
''.__('Subject').' | ',
'from' => ''.__('From').' | ',
'to' => ''.__('To').' | ',
'source' => ''.__('Source').' | ',
'provider' => ''.__('Provider').' | ',
'date_send' => ''.__('Date Send').' | ',
'action' => ''.__('Actions').' | ',
);
foreach($logs_th as $key => $col ){
if(!empty($columns) && array_key_exists($key,$columns)){
echo $col;
}
}
?>
!empty($filter) && $filter != 'all' ? ($filter == 'success' ? 'sent' : 'failed') : '',
'interval' => array(
'start' => $start,
'end' => $end
),
'search' => $search,
);
// Pagination
$perpage = 10;
$records_ct = (int) $logger->get_logs('count', '', $options)->records;
$tpages = ceil($records_ct / $perpage);
$offset = ($curpage - 1) * $perpage;
$options['limit'] = $perpage;
$options['offset'] = $offset;
$args = array(
'base' => '%_%',
'format' => '?paged=%#%',
'total' => $tpages,
'current' => $curpage,
'show_all' => false,
'end_size' => 1,
'mid_size' => 2,
'prev_next' => true,
'type' => 'array',
'add_args' => false
);
$pagination = null;
$pages = paginate_links( $args );
if( is_array( $pages ) ){
$paged = ( get_query_var('paged') == 0 ) ? 1 : get_query_var('paged');
$pagination .= '';
}
$mails = $logger->get_logs('records', 0, $options);
if(!empty($mails)){
foreach($mails as $key => $mail){
$id = $mail->id;
$tos = maybe_unserialize($mail->to);
$to_list = [];
if(is_array($tos)){
foreach($tos as $key => $to){
$to_list[] = $to[0];
}
$to_list = implode(',',$to_list);
}else{
$to_list = $tos;
}
$created_at = date("M d, Y", strtotime($mail->created_at)).' at '. date('h:i A', strtotime($mail->created_at));
$status = $mail->status == 'sent' ? __('Sent') : __('Failed');
$resend_retry = $mail->status == 'sent' ? __('Resend') : __('Retry');
$backup_text = !empty($mail->parent_id) ? __('(Backup)') : '';
$logs_td = array(
'subject' => '
'. (!empty($mail->subject) ? esc_attr($mail->subject) : __('[No Subject]')) .'
| ',
'from' => ''.(!empty($mail->from) ? esc_html($mail->from) : __('NA')).' | ',
'to' => ''.esc_html($to_list).' | ',
'source' => ''.(!empty($mail->source) ? esc_html($mail->source) : __('NA')).' | ',
'provider' => ''.(!empty($mail->provider) ? ucwords(esc_html($mail->provider)).' '.$backup_text : __('NA')).' | ',
'date_send' => ''.esc_html($created_at).' | ',
'action' => '
| '
);
?>
|
$col ){
if(!empty($columns) && array_key_exists($key,$columns)){
echo $col;
}
}
?>
|