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 ). --- Postman/PostmanOptions.php | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'Postman/PostmanOptions.php') diff --git a/Postman/PostmanOptions.php b/Postman/PostmanOptions.php index af88b18..7d8c2a0 100644 --- a/Postman/PostmanOptions.php +++ b/Postman/PostmanOptions.php @@ -138,6 +138,11 @@ if ( ! class_exists( 'PostmanOptions' ) ) { const DEFAULT_PLUGIN_MESSAGE_SENDER_EMAIL_ENFORCED = false; const DEFAULT_TEMP_DIRECTORY = '/tmp'; + const SMTP_MAILERS = [ + 'phpmailer' => 'PHPMailer', + 'postsmtp' => 'PostSMTP' + ]; + public $is_fallback = false; // options data @@ -569,6 +574,15 @@ if ( ! class_exists( 'PostmanOptions' ) ) { $this->setSenderName( $senderName ); } } + + public function getSmtpMailer() { + if ( empty($this->options [ 'smtp_mailers' ]) ) { + return 'postsmtp'; + } + + return $this->options [ 'smtp_mailers' ]; + } + public function isAuthTypePassword() { return $this->isAuthTypeLogin() || $this->isAuthTypeCrammd5() || $this->isAuthTypePlain(); } @@ -603,7 +617,7 @@ if ( ! class_exists( 'PostmanOptions' ) ) { * @see PostmanOptionsInterface::getSenderEmail() */ public function getSenderName() { - return $this->getMessageNameEmail(); + return $this->getMessageSenderName(); } /** @@ -624,7 +638,7 @@ if ( ! class_exists( 'PostmanOptions' ) ) { /** * - * @param unknown $data + * @param mixed $data */ public function import( $data ) { if ( PostmanPreRequisitesCheck::checkZlibEncode() ) { -- cgit v1.2.3