mirror of https://github.com/jumpserver/jumpserver
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
515 B
20 lines
515 B
from common.sdk.sms.endpoint import SMS
|
|
from .base import BackendBase
|
|
|
|
|
|
class SMS(BackendBase):
|
|
account_field = 'phone'
|
|
is_enable_field_in_settings = 'SMS_ENABLED'
|
|
|
|
def __init__(self):
|
|
self.client = SMS()
|
|
|
|
def send_msg(self, users, sign_name: str, template_code: str, template_param: dict):
|
|
accounts, __, __ = self.get_accounts(users)
|
|
if not accounts:
|
|
return
|
|
return self.client.send_sms(accounts, sign_name, template_code, template_param)
|
|
|
|
|
|
backend = SMS
|