diff options
author | yehudah <yehudah@b8457f37-d9ea-0310-8a92-e5e31aec5664> | 2017-11-20 22:02:17 +0000 |
---|---|---|
committer | yehudah <yehudah@b8457f37-d9ea-0310-8a92-e5e31aec5664> | 2017-11-20 22:02:17 +0000 |
commit | a5f8d8dce0f9f7cc373d62a820d07902e02548d7 (patch) | |
tree | d4588eeb10d37ff8cc77162d6efd7abd9ea9a246 /Postman/Postman-Email-Log/PostmanEmailLogController.php | |
parent | c4a84af9a1de9645d1742b71c56f1c06f0d0cba0 (diff) | |
download | Post-SMTP-a5f8d8dce0f9f7cc373d62a820d07902e02548d7.zip |
* Fixed: misspled false
* Fixed: feedback form
* Fixed: Some localization strings
* Removed: deprecated function
* New: Option to input emails when resend email
* Added: explain message on email log filter
Diffstat (limited to 'Postman/Postman-Email-Log/PostmanEmailLogController.php')
-rw-r--r-- | Postman/Postman-Email-Log/PostmanEmailLogController.php | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/Postman/Postman-Email-Log/PostmanEmailLogController.php b/Postman/Postman-Email-Log/PostmanEmailLogController.php index a7bd78a..efb19ae 100644 --- a/Postman/Postman-Email-Log/PostmanEmailLogController.php +++ b/Postman/Postman-Email-Log/PostmanEmailLogController.php @@ -70,13 +70,22 @@ class PostmanEmailLogController { /** */ public function resendMail() { + check_ajax_referer( 'resend', 'security' ); + // get the email address of the recipient from the HTTP Request $postid = $this->getRequestParameter( 'email' ); if ( ! empty( $postid ) ) { $post = get_post( $postid ); $meta_values = get_post_meta( $postid ); - $success = wp_mail( $meta_values ['original_to'] [0], $meta_values ['original_subject'] [0], $meta_values ['original_message'] [0], $meta_values ['original_headers'] [0] ); + if ( isset( $_POST['mail_to'] ) && ! empty( $_POST['mail_to'] ) ) { + $emails = explode( ',', $_POST['mail_to'] ); + $to = array_map( 'sanitize_email', $emails ); + } else { + $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] ); // Postman API: retrieve the result of sending this message from Postman $result = apply_filters( 'postman_wp_mail_result', null ); @@ -288,7 +297,7 @@ class PostmanEmailLogController { $this->logger->trace( 'created PostmanEmailLog admin menu item' ); /* Translators where (%s) is the name of the plugin */ - $pageTitle = sprintf( __( '%s Email Log', Postman::TEXT_DOMAIN ), __( 'Postman SMTP', Postman::TEXT_DOMAIN ) ); + $pageTitle = sprintf( __( '%s Email Log', Postman::TEXT_DOMAIN ), __( 'Post SMTP', Postman::TEXT_DOMAIN ) ); $pluginName = _x( 'Email Log', 'The log of Emails that have been delivered', Postman::TEXT_DOMAIN ); $page = add_submenu_page( PostmanViewController::POSTMAN_MENU_SLUG, $pageTitle, $pluginName, 'read_private_posts', 'postman_email_log', array( $this, 'postman_render_email_page' ) ); @@ -338,7 +347,7 @@ class PostmanEmailLogController { </div> <h2><?php /* Translators where (%s) is the name of the plugin */ - echo sprintf( __( '%s Email Log', Postman::TEXT_DOMAIN ), __( 'Postman SMTP', Postman::TEXT_DOMAIN ) )?></h2> + echo sprintf( __( '%s Email Log', Postman::TEXT_DOMAIN ), __( 'Post SMTP', Postman::TEXT_DOMAIN ) )?></h2> <div style="background: #ECECEC; border: 1px solid #CCC; padding: 0 10px; margin-top: 5px; border-radius: 5px; -moz-border-radius: 5px; -webkit-border-radius: 5px;"> @@ -374,7 +383,8 @@ class PostmanEmailLogController { <div class="form-control"> <!-- <button type="submit" name="export_email_logs" class="button button-primary">Export To CSV</button> --> </div> - </div> + </div> + <div class="error">Please notice: when you select a date for example 11/20/2017, behind the scene the query select <b>11/20/2017 00:00:00</b>.<br>So if you searching for an email arrived that day at any hour you need to select 11/20/2017 as the <b>From Date</b> and 11/21/2017 as the <b>To Date</b>.</div> </form> <!-- Forms are NOT created automatically, so you need to wrap the table in one to use features like bulk actions --> |