summaryrefslogtreecommitdiff
path: root/Postman/Postman-Email-Log
diff options
context:
space:
mode:
Diffstat (limited to 'Postman/Postman-Email-Log')
-rw-r--r--Postman/Postman-Email-Log/PostmanEmailLogController.php9
-rw-r--r--Postman/Postman-Email-Log/PostmanEmailLogView.php6
2 files changed, 9 insertions, 6 deletions
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 @@
<?php
+require_once dirname(__DIR__) . '/PostmanEmailLogs.php';
require_once 'PostmanEmailLogService.php';
require_once 'PostmanEmailLogView.php';
@@ -78,7 +79,7 @@ class PostmanEmailLogController {
$postid = $this->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 '<html><head><style>body {font-family: monospace;} hr {
border: 0;
@@ -260,7 +261,7 @@ class PostmanEmailLogController {
$this->logger->trace( 'handling view transcript 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 '<html><head><style>body {font-family: monospace;} hr {
border: 0;
diff --git a/Postman/Postman-Email-Log/PostmanEmailLogView.php b/Postman/Postman-Email-Log/PostmanEmailLogView.php
index 2f41bcf..a9722bd 100644
--- a/Postman/Postman-Email-Log/PostmanEmailLogView.php
+++ b/Postman/Postman-Email-Log/PostmanEmailLogView.php
@@ -1,5 +1,7 @@
<?php
+require_once dirname(__DIR__) . '/PostmanEmailLogs.php';
+
/**
* See http://wpengineer.com/2426/wp_list_table-a-step-by-step-guide/
*/
@@ -92,7 +94,7 @@ class PostmanEmailLogView extends WP_List_Table {
$transcriptUrl = admin_url( sprintf( $iframeUri, 'transcript', $item ['ID'] ) );
$resendUrl = admin_url( sprintf( $iframeUri, 'resend', $item ['ID'] ) );
- $meta_values = get_post_meta( $item ['ID'] );
+ $meta_values = PostmanEmailLogs::get_data( $item ['ID'] );
$actions = array(
'delete' => sprintf( '<a href="%s">%s</a>', $deleteUrl, _x( 'Delete', 'Delete an item from the email log', 'post-smtp' ) ),
@@ -365,7 +367,7 @@ class PostmanEmailLogView extends WP_List_Table {
/* Translators: where %s indicates the relative time from now */
$date = sprintf( _x( '%s ago', 'A relative time as in "five days ago"', 'post-smtp' ), $humanTime );
}
- $meta_values = get_post_meta( $post->ID );
+ $meta_values = PostmanEmailLogs::get_data( $post->ID );
$sent_to = array_map( 'sanitize_email', explode( ',' , $meta_values ['to_header'] [0] ) );
$flattenedPost = array(
// the post title must be escaped as they are displayed in the HTML output