summaryrefslogtreecommitdiff
path: root/Postman/Postman.php
diff options
context:
space:
mode:
authorYehuda Hassine <yehuda@myinbox.in>2019-05-01 00:25:40 +0300
committerYehuda Hassine <yehuda@myinbox.in>2019-05-01 00:25:40 +0300
commit34356f6d27e564c0d0b687e6cb384e31219222b0 (patch)
tree31cc7bd49e881cc037eca7e2b877e9e9d3a4689f /Postman/Postman.php
parentee4e4461dc0c1ffffc00fbde9698dd379153aa8f (diff)
downloadPost-SMTP-34356f6d27e564c0d0b687e6cb384e31219222b0.zip
smtp mailer + bugs
Diffstat (limited to 'Postman/Postman.php')
-rw-r--r--Postman/Postman.php19
1 files changed, 13 insertions, 6 deletions
diff --git a/Postman/Postman.php b/Postman/Postman.php
index 0c25d66..c832ef6 100644
--- a/Postman/Postman.php
+++ b/Postman/Postman.php
@@ -64,6 +64,7 @@ class Postman {
require_once 'Postman-Email-Log/PostmanEmailLogPostType.php';
require_once 'Postman-Mail/PostmanMyMailConnector.php';
require_once 'Postman-Mail/PostmanContactForm7.php';
+ require_once 'Phpmailer/PostsmtpMailer.php';
//require_once 'Postman-Mail/PostmanWooCommerce.php';
// get plugin metadata - alternative to get_plugin_data
@@ -91,13 +92,19 @@ class Postman {
// register the email transports
$this->registerTransports( $rootPluginFilenameAndPath );
- // store an instance of the WpMailBinder
- $this->wpMailBinder = PostmanWpMailBinder::getInstance();
+ // store an instance of the WpMailBinder
+ $this->wpMailBinder = PostmanWpMailBinder::getInstance();
- // bind to wp_mail - this has to happen before the "init" action
- // this design allows other plugins to register a Postman transport and call bind()
- // bind may be called more than once
- $this->wpMailBinder->bind();
+ $this->logger->trace( 'SMTP Mailer: ' . PostmanOptions::getInstance()->getSmtpMailer() );
+ PostmanWpMailBinder::getInstance()->bound = true;
+ if ( PostmanOptions::getInstance()->getTransportType() == 'smtp' &&
+ PostmanOptions::getInstance()->getSmtpMailer() !== 'phpmailer') {
+
+ // bind to wp_mail - this has to happen before the "init" action
+ // this design allows other plugins to register a Postman transport and call bind()
+ // bind may be called more than once
+ $this->wpMailBinder->bind();
+ }
// registers the custom post type for all callers
PostmanEmailLogPostType::automaticallyCreatePostType();