2022-11-04 05:56:55 +00:00
|
|
|
from common.sdk.sms.endpoint import SMS
|
2021-08-24 06:20:54 +00:00
|
|
|
from .base import BackendBase
|
|
|
|
|
|
|
|
|
|
|
|
class SMS(BackendBase):
|
|
|
|
account_field = 'phone'
|
2021-09-09 12:12:52 +00:00
|
|
|
is_enable_field_in_settings = 'SMS_ENABLED'
|
2021-08-24 06:20:54 +00:00
|
|
|
|
|
|
|
def __init__(self):
|
2022-11-04 05:56:55 +00:00
|
|
|
self.client = SMS()
|
2021-08-24 06:20:54 +00:00
|
|
|
|
|
|
|
def send_msg(self, users, sign_name: str, template_code: str, template_param: dict):
|
|
|
|
accounts, __, __ = self.get_accounts(users)
|
|
|
|
return self.client.send_sms(accounts, sign_name, template_code, template_param)
|
|
|
|
|
|
|
|
|
|
|
|
backend = SMS
|