How to use the sparkpost.django.email_backend.SparkPostEmailBackend function in sparkpost

To help you get started, we’ve selected a few sparkpost examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github SparkPost / python-sparkpost / test / django / test_email_backend.py View on Github external
def test_default_base_uri_retrieval():
    backend = SparkPostEmailBackend()
    assert backend.client.base_uri.startswith('https://' + US_API)
github SparkPost / python-sparkpost / test / django / test_email_backend.py View on Github external
def test_eu_base_uri_retrieval():
    reconfigure_settings(SPARKPOST_BASE_URI=EU_API)
    backend = SparkPostEmailBackend()
    assert backend.client.base_uri.startswith('https://' + EU_API)
github SparkPost / python-sparkpost / test / django / test_email_backend.py View on Github external
def test_password_retrieval():
    backend = SparkPostEmailBackend()
    assert backend.client.api_key == API_KEY
github SparkPost / python-sparkpost / sparkpost / django / email_backend.py View on Github external
def __init__(self, fail_silently=False, **kwargs):
        super(SparkPostEmailBackend, self)\
            .__init__(fail_silently=fail_silently, **kwargs)

        sp_api_key = getattr(settings, 'SPARKPOST_API_KEY', None)
        sp_base_uri = getattr(settings, 'SPARKPOST_BASE_URI', US_API)

        self.client = SparkPost(sp_api_key, sp_base_uri)