Beispiel #1
0
 def send(self, recipient, context_data, related_objects=None, tag=None):
     if self.can_send(recipient, context_data):
         return get_sms_sender().send(recipient,
                                      self.render_body(context_data),
                                      template=self,
                                      related_objects=related_objects,
                                      tag=tag)
     else:
         return None
Beispiel #2
0
def send(recipient, content, related_objects=None, tag=None, **sms_kwargs):
    """
    Helper for sending SMS 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 sms_kwargs: extra attributes that will be stored with messages
    :return: True if SMS was successfully sent or False if message is in error state
    """
    return get_sms_sender().send(recipient,
                                 content,
                                 related_objects=related_objects,
                                 tag=tag,
                                 **sms_kwargs).failed
 def handle(self, *args, **kwargs):
     get_sms_sender().bulk_check_sms_states()
Beispiel #4
0
 def get_backend_sender(self):
     return get_sms_sender()