forked from Kamva-Academy/Kamva-Backend
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7 from sepid-org/notification-system
update and change it
- Loading branch information
Showing
3 changed files
with
25 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import requests | ||
|
||
# from manage_content_service.settings.base import get_environment_var | ||
# | ||
# url = get_environment_var( | ||
# 'INSTANT_MESSAGE_URL', 'https://ims.sepid.org/') | ||
# | ||
url = 'https://ims.sepid.org' | ||
|
||
class NotifServiceProxy(): | ||
def __init__(self ,website): | ||
self.website= website | ||
self.notif = None | ||
|
||
|
||
def send_notification(self, reciver , message): | ||
self.notif = message | ||
res = requests.post(f'{url}/send-message', json={'sender':self.website , 'reciver':reciver , 'message':self.notif}) | ||
return res.status_code | ||
|
||
|
||
|
Empty file.