def _send(self): module = import_module(self._provider) message = clean_html(self._message) for phone in self._recipient_list: if self._from_email: module.send( phone, message, sms_from=self._from_email, **self._kwargs) else: module.send(phone, message, **self._kwargs)
def _send(self): self._provider = self._provider or self.provider module = import_module(self._provider) message = clean_html(self._message) for phone in self._recipient_list: if self._from_email: module.send( phone, message, sms_from=self._from_email, **self._kwargs) else: module.send(phone, message, **self._kwargs)
def _send(self): self._provider = self._provider or self.provider module = import_module(self._provider) message = clean_html(self._message) for phone in self._recipient_list: options = self._kwargs.copy() options['event'] = self._kwargs.pop('event', self._subject) if self._from_email: options['app'] = self._from_email module.send(phone, message, **options)
def _send(self): message = clean_html(self._message) options = self._kwargs.copy() options.update(message=message, event=self._kwargs.pop('event', self._subject)) if self._from_email: options['app'] = self._from_email module = import_module(self._provider) for address in self._recipient_list: module.send(address, **options)
def _send(self): message = clean_html(self._message) options = self._kwargs.copy() options.update( message=message, event=self._kwargs.pop('event', self._subject) ) if self._from_email: options['app'] = self._from_email module = import_module(self._provider) for address in self._recipient_list: module.send(address, **options)
def db_sender(*args, **kwargs): from dbmail import import_module retry_delay = kwargs.pop('retry_delay', SEND_RETRY_DELAY) time_limit = kwargs.pop('time_limit', SEND_MAX_TIME) max_retries = kwargs.pop('max_retries', SEND_RETRY) backend = import_module(kwargs.get('backend')) retry = kwargs.pop('retry', True) try: if DEBUG is True: return backend.SenderDebug(*args, **kwargs).send(is_celery=True) return backend.Sender(*args, **kwargs).send(is_celery=True) except Exception as exc: if retry is True and max_retries: raise db_sender.retry( retry=retry, max_retries=max_retries, countdown=retry_delay, exc=exc, time_limit=time_limit, ) raise
def _send(self): module = import_module(self.provider) for recipient in self._recipient_list: module.send(recipient, self._message)
def _send_by_custom_provider(self): module = import_module(self._provider) module.send(self)
def _send(self): module = import_module(self._provider) message = clean_html(self._message) for _id in self._recipient_list: module.send(_id, message, _from=self._from_email, **self._kwargs)
def clean_html(message): from dbmail.defaults import MESSAGE_HTML2TEXT module = import_module(MESSAGE_HTML2TEXT) return module.html2text(message)