diff options
author | yehudah <yehudah@b8457f37-d9ea-0310-8a92-e5e31aec5664> | 2020-01-13 06:59:45 +0000 |
---|---|---|
committer | yehudah <yehudah@b8457f37-d9ea-0310-8a92-e5e31aec5664> | 2020-01-13 06:59:45 +0000 |
commit | 3686a6e1793a2c5af8b7ee4459e20887f08dc720 (patch) | |
tree | 88f1846b220499ca3fe9809064ba5e6070e642d9 /Postman | |
parent | 2850339b7b0f53042c2f27e7802e273c36d1cef8 (diff) | |
download | Post-SMTP-3686a6e1793a2c5af8b7ee4459e20887f08dc720.zip |
* Fixed: Notify on error bug - crash site
* Fixed: From header
Diffstat (limited to 'Postman')
-rw-r--r-- | Postman/Extensions/Core/Notifications/PostmanNotify.php | 4 | ||||
-rw-r--r-- | Postman/Extensions/Core/Notifications/PostmanNotifyOptions.php | 13 | ||||
-rw-r--r-- | Postman/Phpmailer/PostsmtpMailer.php | 2 |
3 files changed, 16 insertions, 3 deletions
diff --git a/Postman/Extensions/Core/Notifications/PostmanNotify.php b/Postman/Extensions/Core/Notifications/PostmanNotify.php index d9f6a58..ae505cf 100644 --- a/Postman/Extensions/Core/Notifications/PostmanNotify.php +++ b/Postman/Extensions/Core/Notifications/PostmanNotify.php @@ -15,9 +15,11 @@ class PostmanNotify { const NOTIFICATIONS_PUSHOVER_CRED = 'postman_pushover_cred'; const NOTIFICATIONS_SLACK_CRED = 'postman_slack_cred'; + private $options; + public function __construct() { - $this->options = new PostmanNotifyOptions(); + $this->options = PostmanNotifyOptions::getInstance(); add_filter( 'post_smtp_admin_tabs', array( $this, 'tabs' ) ); add_action( 'post_smtp_settings_menu', array( $this, 'menu' ) ); diff --git a/Postman/Extensions/Core/Notifications/PostmanNotifyOptions.php b/Postman/Extensions/Core/Notifications/PostmanNotifyOptions.php index 08c27db..2973eb9 100644 --- a/Postman/Extensions/Core/Notifications/PostmanNotifyOptions.php +++ b/Postman/Extensions/Core/Notifications/PostmanNotifyOptions.php @@ -12,7 +12,18 @@ class PostmanNotifyOptions { private $options; - public function __construct() + private static $instance; + + public static function getInstance() + { + if ( ! self::$instance ) { + self::$instance = new static; + } + + return self::$instance; + } + + private function __construct() { $this->options = get_option( 'postman_options' ); } diff --git a/Postman/Phpmailer/PostsmtpMailer.php b/Postman/Phpmailer/PostsmtpMailer.php index e52091d..838cdc5 100644 --- a/Postman/Phpmailer/PostsmtpMailer.php +++ b/Postman/Phpmailer/PostsmtpMailer.php @@ -39,7 +39,7 @@ class PostsmtpMailer extends PHPMailer { public function hooks() { if ( $this->options->getTransportType() == 'smtp' ) { - add_action( 'phpmailer_init', array( $this, 'phpmailer_smtp_init' ) ); + add_action( 'phpmailer_init', array( $this, 'phpmailer_smtp_init' ), 999 ); } } |