From 7781aa65cef32d8c8196979edb21ec4551e5b904 Mon Sep 17 00:00:00 2001 From: Yehuda Hassine Date: Mon, 22 Apr 2019 00:23:38 +0300 Subject: better meta query,bugs, optimization --- .../PostmanEmailLogController.php | 9 +- Postman/Postman-Email-Log/PostmanEmailLogView.php | 6 +- Postman/PostmanEmailLogs.php | 111 +++++++++++++++++++++ Postman/PostmanInstaller.php | 5 +- Postman/PostmanLogMeta.php | 76 -------------- Postman/PostmanUtils.php | 18 +--- Postman/PostmanWpMail.php | 4 + 7 files changed, 126 insertions(+), 103 deletions(-) create mode 100644 Postman/PostmanEmailLogs.php delete mode 100644 Postman/PostmanLogMeta.php diff --git a/Postman/Postman-Email-Log/PostmanEmailLogController.php b/Postman/Postman-Email-Log/PostmanEmailLogController.php index 530b3a5..f625a82 100644 --- a/Postman/Postman-Email-Log/PostmanEmailLogController.php +++ b/Postman/Postman-Email-Log/PostmanEmailLogController.php @@ -1,4 +1,5 @@ getRequestParameter( 'email' ); if ( ! empty( $postid ) ) { $post = get_post( $postid ); - $meta_values = get_post_meta( $postid ); + $meta_values = PostmanEmailLogs::get_data( $postid ); if ( isset( $_POST['mail_to'] ) && ! empty( $_POST['mail_to'] ) ) { $emails = explode( ',', $_POST['mail_to'] ); @@ -87,7 +88,7 @@ class PostmanEmailLogController { $to = $meta_values ['original_to'] [0]; } - $success = wp_mail( $to, $meta_values ['original_subject'] [0], $meta_values ['original_message'] [0], $meta_values ['original_headers'] [0] ); + $success = wp_mail( $to, $meta_values ['original_subject'] [0], maybe_unserialize( $meta_values ['original_message'] [0] ), $meta_values ['original_headers'] [0] ); // Postman API: retrieve the result of sending this message from Postman $result = apply_filters( 'postman_wp_mail_result', null ); @@ -202,7 +203,7 @@ class PostmanEmailLogController { $this->logger->trace( 'handling view item' ); $postid = $_REQUEST ['email']; $post = get_post( $postid ); - $meta_values = get_post_meta( $postid ); + $meta_values = PostmanEmailLogs::get_data( $postid ); // https://css-tricks.com/examples/hrs/ print '