From 38153c0f3e739f3d89a1a7734fd7d199bf457fab Mon Sep 17 00:00:00 2001 From: yehudah Date: Wed, 15 May 2019 12:14:32 +0000 Subject: = 2.0 - 2019-05-15 * New: Mailer Type - Added an option to send without overwrite the 'wp_mail' function, better compability to WordPress delivery. hopefully will be the default in the future. * Updated: Sendgrid API was upgraded and rewritten to the new version. * Fixed: Message-Id header was missing on SMTP * Fixed: Email logger optimization - better query for large amount of records. * Fixed: The localization was fixed to match translate.wordpress.org translation system ( Thanks to Niels de Blaauw from Level-Level ). * Fixed: Code and optimization ( Thanks to Niels de Blaauw from Level-Level ). --- .../PostmanSendTestEmailController.php | 52 +++++++++++----------- 1 file changed, 26 insertions(+), 26 deletions(-) (limited to 'Postman/Postman-Send-Test-Email/PostmanSendTestEmailController.php') diff --git a/Postman/Postman-Send-Test-Email/PostmanSendTestEmailController.php b/Postman/Postman-Send-Test-Email/PostmanSendTestEmailController.php index 55b7d49..b569c98 100644 --- a/Postman/Postman-Send-Test-Email/PostmanSendTestEmailController.php +++ b/Postman/Postman-Send-Test-Email/PostmanSendTestEmailController.php @@ -13,7 +13,7 @@ class PostmanSendTestEmailController { /** * Constructor * - * @param unknown $rootPluginFilenameAndPath + * @param mixed $rootPluginFilenameAndPath */ public function __construct( $rootPluginFilenameAndPath ) { assert( ! empty( $rootPluginFilenameAndPath ) ); @@ -90,7 +90,7 @@ class PostmanSendTestEmailController { * Register the Email Test screen */ public function addEmailTestSubmenu() { - $page = add_submenu_page( null, sprintf( __( '%s Setup', Postman::TEXT_DOMAIN ), __( 'Postman SMTP', Postman::TEXT_DOMAIN ) ), __( 'Postman SMTP', Postman::TEXT_DOMAIN ), Postman::MANAGE_POSTMAN_CAPABILITY_NAME, PostmanSendTestEmailController::EMAIL_TEST_SLUG, array( + $page = add_submenu_page( null, sprintf( __( '%s Setup', 'post-smtp' ), __( 'Postman SMTP', 'post-smtp' ) ), __( 'Postman SMTP', 'post-smtp' ), Postman::MANAGE_POSTMAN_CAPABILITY_NAME, PostmanSendTestEmailController::EMAIL_TEST_SLUG, array( $this, 'outputTestEmailContent', ) ); @@ -110,11 +110,11 @@ class PostmanSendTestEmailController { wp_enqueue_script( 'postman_test_email_wizard_script' ); wp_localize_script( PostmanViewController::POSTMAN_SCRIPT, 'postman_email_test', array( 'recipient' => '#' . self::RECIPIENT_EMAIL_FIELD_NAME, - 'not_started' => _x( 'In Outbox', 'Email Test Status', Postman::TEXT_DOMAIN ), - 'sending' => _x( 'Sending...', 'Email Test Status', Postman::TEXT_DOMAIN ), - 'success' => _x( 'Success', 'Email Test Status', Postman::TEXT_DOMAIN ), - 'failed' => _x( 'Failed', 'Email Test Status', Postman::TEXT_DOMAIN ), - 'ajax_error' => __( 'Ajax Error', Postman::TEXT_DOMAIN ), + 'not_started' => _x( 'In Outbox', 'Email Test Status', 'post-smtp' ), + 'sending' => _x( 'Sending...', 'Email Test Status', 'post-smtp' ), + 'success' => _x( 'Success', 'Email Test Status', 'post-smtp' ), + 'failed' => _x( 'Failed', 'Email Test Status', 'post-smtp' ), + 'ajax_error' => __( 'Ajax Error', 'post-smtp' ), ) ); } @@ -123,42 +123,42 @@ class PostmanSendTestEmailController { public function outputTestEmailContent() { print '
'; - PostmanViewController::outputChildPageHeader( __( 'Send a Test Email', Postman::TEXT_DOMAIN ) ); + PostmanViewController::outputChildPageHeader( __( 'Send a Test Email', 'post-smtp' ) ); printf( '
', PostmanUtils::getSettingsPageUrl() ); // Step 1 - printf( '
%s
', __( 'Specify the Recipient', Postman::TEXT_DOMAIN ) ); + printf( '
%s
', __( 'Specify the Recipient', 'post-smtp' ) ); print '
'; - printf( '%s', __( 'Who is this message going to?', Postman::TEXT_DOMAIN ) ); - printf( '

%s', __( 'This utility allows you to send an email message for testing.', Postman::TEXT_DOMAIN ) ); + printf( '%s', __( 'Who is this message going to?', 'post-smtp' ) ); + printf( '

%s', __( 'This utility allows you to send an email message for testing.', 'post-smtp' ) ); print ' '; /* translators: where %d is an amount of time, in seconds */ - printf( '%s

', sprintf( _n( 'If there is a problem, Postman will give up after %d second.', 'If there is a problem, Postman will give up after %d seconds.', $this->options->getReadTimeout(), Postman::TEXT_DOMAIN ), $this->options->getReadTimeout() ) ); - printf( '', _x( 'Recipient Email Address', 'Configuration Input Field', Postman::TEXT_DOMAIN ) ); + printf( '%s

', sprintf( _n( 'If there is a problem, Postman will give up after %d second.', 'If there is a problem, Postman will give up after %d seconds.', $this->options->getReadTimeout(), 'post-smtp' ), $this->options->getReadTimeout() ) ); + printf( '', _x( 'Recipient Email Address', 'Configuration Input Field', 'post-smtp' ) ); print $this->test_email_callback(); print '
'; // Step 2 - printf( '
%s
', __( 'Send The Message', Postman::TEXT_DOMAIN ) ); + printf( '
%s
', __( 'Send The Message', 'post-smtp' ) ); print '
'; print ''; - print __( 'Sending the message:', Postman::TEXT_DOMAIN ); - printf( ' %s', _x( 'In Outbox', 'Email Test Status', Postman::TEXT_DOMAIN ) ); + print __( 'Sending the message:', 'post-smtp' ); + printf( ' %s', _x( 'In Outbox', 'Email Test Status', 'post-smtp' ) ); print ''; print '
'; - printf( '

', __( 'Status', Postman::TEXT_DOMAIN ) ); + printf( '

', __( 'Status', 'post-smtp' ) ); print ''; print '
'; print '
'; // Step 3 - printf( '
%s
', __( 'Session Transcript', Postman::TEXT_DOMAIN ) ); + printf( '
%s
', __( 'Session Transcript', 'post-smtp' ) ); print '
'; - printf( '%s', __( 'Examine the Session Transcript if you need to.', Postman::TEXT_DOMAIN ) ); - printf( '

%s

', __( 'This is the conversation between Postman and the mail server. It can be useful for diagnosing problems. DO NOT post it on-line, it may contain your account password.', Postman::TEXT_DOMAIN ) ); + printf( '%s', __( 'Examine the Session Transcript if you need to.', 'post-smtp' ) ); + printf( '

%s

', __( 'This is the conversation between Postman and the mail server. It can be useful for diagnosing problems. DO NOT post it on-line, it may contain your account password.', 'post-smtp' ) ); print '
'; - printf( '

', __( 'Session Transcript', Postman::TEXT_DOMAIN ) ); + printf( '

', __( 'Session Transcript', 'post-smtp' ) ); print ''; print '
'; print '
'; @@ -206,7 +206,7 @@ class PostmanSendTestEmailAjaxController extends PostmanAbstractAjaxHandler { $serverName = PostmanUtils::postmanGetServerName(); /* translators: where %s is the domain name of the site */ - $subject = sprintf( _x( 'Postman SMTP Test (%s)', 'Test Email Subject', Postman::TEXT_DOMAIN ), $serverName ); + $subject = sprintf( _x( 'Postman SMTP Test (%s)', 'Test Email Subject', 'post-smtp' ), $serverName ); // Postman API: indicate to Postman this is just for testing add_filter( 'postman_test_email', array( @@ -236,7 +236,7 @@ class PostmanSendTestEmailAjaxController extends PostmanAbstractAjaxHandler { if ( $success ) { $this->logger->debug( 'Test Email delivered to server' ); // the message was sent successfully, generate an appropriate message for the user - $statusMessage = sprintf( __( 'Your message was delivered (%d ms) to the SMTP server! Congratulations :)', Postman::TEXT_DOMAIN ), $result ['time'] ); + $statusMessage = sprintf( __( 'Your message was delivered (%d ms) to the SMTP server! Congratulations :)', 'post-smtp' ), $result ['time'] ); $this->logger->debug( 'statusmessage: ' . $statusMessage ); @@ -292,9 +292,9 @@ class PostmanSendTestEmailAjaxController extends PostmanAbstractAjaxHandler { // English - Mandarin - French - Hindi - Spanish - Portuguese - Russian - Japanese // http://www.pinyin.info/tools/converter/chars2uninumbers.html $greeting = 'Hello! - 你好 - Bonjour! - नमस्ते - ¡Hola! - Olá - Привет! - 今日は'; - $sentBy = sprintf( _x( 'Sent by Postman %s', 'Test Email Tagline', Postman::TEXT_DOMAIN ), $pluginData ['version'] ); - $imageSource = __( 'Image source', Postman::TEXT_DOMAIN ); - $withPermission = __( 'Used with permission', Postman::TEXT_DOMAIN ); + $sentBy = sprintf( _x( 'Sent by Postman %s', 'Test Email Tagline', 'post-smtp' ), $pluginData ['version'] ); + $imageSource = __( 'Image source', 'post-smtp' ); + $withPermission = __( 'Used with permission', 'post-smtp' ); $messageArray = array( 'Content-Type: text/plain; charset = "UTF-8"', 'Content-Transfer-Encoding: 8bit', -- cgit v1.2.3