diff options
Diffstat (limited to 'Postman/Postman-Email-Log/PostmanEmailLogService.php')
-rw-r--r-- | Postman/Postman-Email-Log/PostmanEmailLogService.php | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/Postman/Postman-Email-Log/PostmanEmailLogService.php b/Postman/Postman-Email-Log/PostmanEmailLogService.php index 75c3879..eeb25c6 100644 --- a/Postman/Postman-Email-Log/PostmanEmailLogService.php +++ b/Postman/Postman-Email-Log/PostmanEmailLogService.php @@ -3,6 +3,8 @@ if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly } +require_once dirname(__DIR__ ) . '/PostmanLogFields.php'; + if ( ! class_exists( 'PostmanEmailLog' ) ) { class PostmanEmailLog { public $sender; @@ -153,32 +155,32 @@ if ( ! class_exists( 'PostmanEmailLogService' ) ) { $this->logger->trace( $log ); // Write the meta data related to the email - update_post_meta( $post_id, 'success', $log->success ); - update_post_meta( $post_id, 'from_header', $log->sender ); + PostmanLogFields::get_instance()->update( $post_id, 'success', $log->success ); + PostmanLogFields::get_instance()->update( $post_id, 'from_header', $log->sender ); if ( ! empty( $log->toRecipients ) ) { - update_post_meta( $post_id, 'to_header', $log->toRecipients ); + PostmanLogFields::get_instance()->update( $post_id, 'to_header', $log->toRecipients ); } if ( ! empty( $log->ccRecipients ) ) { - update_post_meta( $post_id, 'cc_header', $log->ccRecipients ); + PostmanLogFields::get_instance()->update( $post_id, 'cc_header', $log->ccRecipients ); } if ( ! empty( $log->bccRecipients ) ) { - update_post_meta( $post_id, 'bcc_header', $log->bccRecipients ); + PostmanLogFields::get_instance()->update( $post_id, 'bcc_header', $log->bccRecipients ); } if ( ! empty( $log->replyTo ) ) { - update_post_meta( $post_id, 'reply_to_header', $log->replyTo ); + PostmanLogFields::get_instance()->update( $post_id, 'reply_to_header', $log->replyTo ); } - update_post_meta( $post_id, 'transport_uri', $log->transportUri ); + PostmanLogFields::get_instance()->update( $post_id, 'transport_uri', $log->transportUri ); if ( ! $log->success || true ) { // alwas add the meta data so we can re-send it - update_post_meta( $post_id, 'original_to', $log->originalTo ); - update_post_meta( $post_id, 'original_subject', $log->originalSubject ); - update_post_meta( $post_id, 'original_message', $log->originalMessage ); - update_post_meta( $post_id, 'original_headers', $log->originalHeaders ); + PostmanLogFields::get_instance()->update( $post_id, 'original_to', $log->originalTo ); + PostmanLogFields::get_instance()->update( $post_id, 'original_subject', $log->originalSubject ); + PostmanLogFields::get_instance()->update( $post_id, 'original_message', $log->originalMessage ); + PostmanLogFields::get_instance()->update( $post_id, 'original_headers', $log->originalHeaders ); } // we do not sanitize the session transcript - let the reader decide how to handle the data - update_post_meta( $post_id, 'session_transcript', $log->sessionTranscript ); + PostmanLogFields::get_instance()->update( $post_id, 'session_transcript', $log->sessionTranscript ); // truncate the log (remove older entries) $purger = new PostmanEmailLogPurger(); |