modify notification client
This commit is contained in:
parent
7e4473bb0b
commit
eb29c12558
1 changed files with 8 additions and 4 deletions
|
|
@ -166,11 +166,15 @@ class User(AbstractUser):
|
|||
return result
|
||||
|
||||
def send_otp(self):
|
||||
sms_body = f'Gooyal OTP: {self.otp}'
|
||||
self.notify(sms_body)
|
||||
self.notify(body=str(self.otp), title='OTP ')
|
||||
|
||||
def notify(self, body, notification_type='sms'):
|
||||
service_client.notify(phone_number=self.phone_number, body=body)
|
||||
def notify(self, body, title= None, notification_type='sms'):
|
||||
print(service_client.notification.submit_notification(phone_number=self.phone_number,
|
||||
title=title,
|
||||
body=body,
|
||||
user_uuid=self.uuid,
|
||||
notification_type=1,
|
||||
))
|
||||
|
||||
|
||||
def __str__(self):
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue