modify notification client

This commit is contained in:
Sayyid Hamid Mahdavi 2020-09-14 16:30:15 +04:30
parent 7e4473bb0b
commit eb29c12558

View file

@ -166,11 +166,15 @@ class User(AbstractUser):
return result return result
def send_otp(self): def send_otp(self):
sms_body = f'Gooyal OTP: {self.otp}' self.notify(body=str(self.otp), title='OTP ')
self.notify(sms_body)
def notify(self, body, notification_type='sms'): def notify(self, body, title= None, notification_type='sms'):
service_client.notify(phone_number=self.phone_number, body=body) 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): def __str__(self):