Shortcut functions

bambu_mail.shortcuts.render_to_mail(subject, template, context, recipient, fail_silently=False)
Parameters:
  • subject – The subject line of the email
  • template – The name of the template to render the HTML email with
  • context – The context data to pass to the template
  • recipient – The email address or django.contrib.auth.User object to send the email to
  • fail_silently – Set to True to avoid errors being raised by the sender

This function acts as an alias to one of two functions, depending on your setup. If you use Celery, this function will perform the compositing and sending of the email asynchronously. Otherwise the process will take place on the same thread.

bambu_mail.shortcuts.subscribe(email, **kwargs)
Parameters:
  • email – The email address of the user to add to the mailing list
  • kwargs – Keyword arguments to pass to the individual newsletter provider

This function acts as an alias to one of two functions, depending on your setup. If you use Celery, this function will perform the API calls asynchronously. Otherwise the process will take place on the same thread.