access_token = sanitize_text_field( $_GET['access_token'] ); $this->log_id = sanitize_text_field( $_GET['log_id'] ); $this->type = sanitize_text_field( $_GET['type'] ); $this->render_html(); } } public function render_html() { $device = get_option( 'post_smtp_mobile_app_connection' ); if( empty( $this->access_token ) ) { wp_send_json_error( array( 'error' => 'Auth token missing.' ), 400 ); } //Valid Request elseif( $device && isset( $device[$this->access_token] ) ) { if( !class_exists( 'PostmanEmailQueryLog' ) ) { require POST_SMTP_PATH . '/Postman/Postman-Email-Log/PostmanEmailQueryLog.php'; } $logs_query = new PostmanEmailQueryLog(); if( $this->type == 'log' ) { $log = $logs_query->get_log( $this->log_id, array( 'from_header', 'original_to', 'time', 'original_subject', 'transport_uri', 'original_message' ) ); if( empty( $log ) ) { wp_send_json_error( array( 'message' => "{$this->type} not found for id {$this->log_id}" ), 404 ); } $date_format = get_option( 'date_format' ); $time_format = get_option( 'time_format' ); ?>
| From: | |
| To: | |
| Date: | |
| Subject: | |
| Delivery-URI: |