def send(self, recipient, context_data, related_objects=None, tag=None, **kwargs): if self.can_send(recipient, context_data): return get_dialer_sender().send(recipient, self.render_body(context_data), template=self, related_objects=related_objects, tag=tag) else: return None
def send(recipient, content, related_objects=None, tag=None, **kwargs): """ Helper for sending dialer message. :param recipient: phone number of the recipient :param content: text content of the messages :param related_objects: :param tag: string mark that will be saved with the message :param kwargs: extra attributes that will be stored with messages :return: True if dialer was successfully sent or False if message is in error state """ return _send(recipient, content, related_objects, tag, message_sender=get_dialer_sender(), **kwargs)
def handle(self, *args, **kwargs): get_dialer_sender().bulk_check_dialer_status()
def get_backend_sender(self): return get_dialer_sender()