summaryrefslogtreecommitdiff
path: root/Postman/PostmanOptions.php
diff options
context:
space:
mode:
authoryehuda <yehuda@myinbox.in>2019-05-16 12:15:39 +0300
committeryehuda <yehuda@myinbox.in>2019-05-16 12:15:39 +0300
commit6b0c4d5d97cac613ad8218fc9f0779eec63c28e3 (patch)
tree3ac2513ad5cb08650b03f55d837cf6b1d578dd21 /Postman/PostmanOptions.php
parentc88e7ad0b42cefd8fb7b509c8c2e355f567d9434 (diff)
parent09ad01149ef5981407149bc3c9502058482fb419 (diff)
downloadPost-SMTP-6b0c4d5d97cac613ad8218fc9f0779eec63c28e3.zip
Merge remote-tracking branch 'origin/dev'
Diffstat (limited to 'Postman/PostmanOptions.php')
-rw-r--r--Postman/PostmanOptions.php21
1 files changed, 17 insertions, 4 deletions
diff --git a/Postman/PostmanOptions.php b/Postman/PostmanOptions.php
index b6eaaf4..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
@@ -174,10 +179,9 @@ if ( ! class_exists( 'PostmanOptions' ) ) {
if ( is_multisite() ) {
$network_options = get_site_option( self::POSTMAN_NETWORK_OPTIONS );
+ $blog_id = get_current_blog_id();
if ( isset( $network_options['post_smtp_global_settings'] ) ) {
$blog_id = apply_filters( 'post_smtp_default_site_option', 1 );
- } elseif ( $options && isset( $network_options['post_smtp_allow_overwrite'] ) ) {
- $blog_id = get_current_blog_id();
}
switch_to_blog($blog_id);
@@ -570,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();
}
@@ -604,7 +617,7 @@ if ( ! class_exists( 'PostmanOptions' ) ) {
* @see PostmanOptionsInterface::getSenderEmail()
*/
public function getSenderName() {
- return $this->getMessageNameEmail();
+ return $this->getMessageSenderName();
}
/**
@@ -625,7 +638,7 @@ if ( ! class_exists( 'PostmanOptions' ) ) {
/**
*
- * @param unknown $data
+ * @param mixed $data
*/
public function import( $data ) {
if ( PostmanPreRequisitesCheck::checkZlibEncode() ) {