summaryrefslogtreecommitdiff
path: root/Postman/notifications/PostmanNotify.php
diff options
context:
space:
mode:
Diffstat (limited to 'Postman/notifications/PostmanNotify.php')
-rw-r--r--Postman/notifications/PostmanNotify.php22
1 files changed, 22 insertions, 0 deletions
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