diff options
Diffstat (limited to 'Postman/Postman.php')
-rw-r--r-- | Postman/Postman.php | 19 |
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(); |