diff options
Diffstat (limited to 'Postman/notifications')
-rw-r--r-- | Postman/notifications/PostmanMailNotify.php | 2 | ||||
-rw-r--r-- | Postman/notifications/PostmanNotify.php | 22 |
2 files changed, 23 insertions, 1 deletions
diff --git a/Postman/notifications/PostmanMailNotify.php b/Postman/notifications/PostmanMailNotify.php index 795afaa..0313f7f 100644 --- a/Postman/notifications/PostmanMailNotify.php +++ b/Postman/notifications/PostmanMailNotify.php @@ -4,7 +4,7 @@ class PostmanMailNotify implements Postman_Notify { public function send_message($message) { - $to_email = get_bloginfo( 'admin_email' ); + $to_email = apply_filters( 'post_smtp_notify_email',get_bloginfo( 'admin_email' ) ); $domain = get_bloginfo( 'url' ); mail( $to_email, "{$domain}: " . __( 'Post SMTP email error', Postman::TEXT_DOMAIN ), $message , '', "-f{$to_email}" ); diff --git a/Postman/notifications/PostmanNotify.php b/Postman/notifications/PostmanNotify.php index 22ca56f..365d708 100644 --- a/Postman/notifications/PostmanNotify.php +++ b/Postman/notifications/PostmanNotify.php @@ -14,4 +14,26 @@ class PostmanNotify { public function send( $message, $log ) { $this->notify->send_message( $message ); } + + public function push_to_chrome($message) { + $push_chrome = PostmanOptions::getInstance()->useChromeExtension(); + + if ( $push_chrome ) { + $uid = PostmanOptions::getInstance()->getNotificationChromeUid(); + + if ( empty( $uid ) ) { + return; + } + + $url = 'https://postmansmtp.com/chrome/' . $uid; + + $args = array( + 'body' => array( + 'message' => $message + ) + ); + + $response = wp_remote_post( $url , $args ); + } + } }
\ No newline at end of file |