summaryrefslogtreecommitdiff
path: root/Postman/notifications/PostmanNotify.php
diff options
context:
space:
mode:
authoryehuda <yehuda@myinbox.in>2019-03-04 16:40:35 +0200
committeryehuda <yehuda@myinbox.in>2019-03-04 16:40:35 +0200
commite33f6bd6bce974ec0d9836e1589ea1facf159841 (patch)
tree5dc30b48323d8379a858326ab728c94e6455eba5 /Postman/notifications/PostmanNotify.php
parent18c7ae6216c4705a2942b07081469c4c0f1059fd (diff)
downloadPost-SMTP-e33f6bd6bce974ec0d9836e1589ea1facf159841.zip
* Added support for our new chrome notification extension.
* few fixes
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