columnManager = $columnManager;
}
abstract function render($item);
protected function getHiddenColumns() {
return [
WPML_ColumnManager::COLUMN_MAIL_ID,
WPML_ColumnManager::COLUMN_PLUGIN_VERSION
];
}
public function renderRawOrHtmlModal( $item, $message ) {
$content_keys = [
'timestamp' => __( 'Time', 'wp-mail-logging' ),
'receiver' => __( 'Receiver', 'wp-mail-logging' ),
'subject' => __( 'Subject', 'wp-mail-logging' ),
'error' => __( 'Error', 'wp-mail-logging' ),
'headers' => __( 'Headers', 'wp-mail-logging' ),
'message' => __( 'Message', 'wp-mail-logging' ),
'attachments' => __( 'Attachments', 'wp-mail-logging' ),
];
$settings = SettingsTab::get_settings( SettingsTab::DEFAULT_SETTINGS );
if ( ! empty( $settings['display-host' ] ) && $settings['display-host'] == '1' ) {
$content_keys['host'] = __( 'Host', 'wp-mail-logging' );
}
ob_start();
?>
$label ) {
if ( empty( $item[ $key ] ) ) {
continue;
}
switch ( $key ) {
case 'timestamp':
$value = date_i18n( apply_filters( 'wpml_get_date_time_format', '' ), strtotime( $item['timestamp'] ) );
break;
case 'attachments':
$attachmentsCol = new AttachmentsColumn();
$value = $attachmentsCol->render( $item, ColumnFormat::FULL );
break;
default:
$value = $item[ $key ];
break;
}
?>
render_message_value( $item, $settings['preferred-mail-format'] );
} else {
$this->render_column_value( $key, $value );
}
?>
absint( $mail['mail_id'] ),
'mode' => 'iframe_preview',
],
wp_nonce_url( WPML_Utils::get_admin_page_url(), EmailLogsTab::SINGLE_EMAIL_CONTENT_PREVIEW_MODE_NONCE, EmailLogsTab::SINGLE_EMAIL_CONTENT_PREVIEW_MODE_NONCE )
);
$iframe_title = sprintf(
/* translators: %d - Email Log ID. */
__( "Email Log ID Content: %d" ),
absint( $mail['mail_id'] )
)
?>
render(
[
'subject' => $value,
],
ColumnFormat::SIMPLE
);
} catch ( \Exception $e ) {}
}
$values_to_escape = [
WPML_ColumnManager::COLUMN_SUBJECT,
WPML_ColumnManager::COLUMN_RECEIVER,
WPML_ColumnManager::COLUMN_HEADERS,
];
if ( in_array( $key, $values_to_escape, true ) ) {
echo esc_html( $value );
} else {
echo wp_kses_post( $value );
}
if ( $key === 'error' ) {
?>
This email failed to send. Install WP Mail SMTP to solve your deliverability issues.', 'wp-mail-logging' ),
[
'a' => [
'href' => [],
],
'strong' => [],
]
),
esc_url( SMTPTab::get_url() )
);
?>