Skip to main content

Subscribe Mailgun mailing lists from Django

Project description

This Django module provides a FormView and a Form that subscribe the user to a list on Mailgun.

Usage

  1. Install:

    pip install django-mgsub
    pip freeze | grep django-mgsub >> requirements.txt
  2. Add to Django:

    # settings.py
    INSTALLED_APPS += 'mgsub',
  3. Configure credentials:

    # settings.py
    MGSUB_DEFAULT_MAILINGLIST = 'mylist@example.com'
    MAILGUN_API_KEY = '<secret>'

    or:

    export MGSUB_DEFAULT_MAILINGLIST='mylist@example.com' MAILGUN_API_KEY=...
  4. Add urls:

    # urls.py
    urlpatterns = [
      ...
        url('^mailinglist/', include('mgsub.urls', namespace='mgsub')),
      ...
    ]
  5. Configure:

    ## settings.py
    
    # Setting this to False will disable email sending and the following
    # settings
    MGSUB_SEND_WELCOME = True
    
    MGSUB_WELCOME_FROM = 'noreply@example.com'    # defaults to settings.SERVER_EMAIL
    MGSUB_WELCOME_REPLY_TO = 'me@example.com'     # nothing by default
    
    # Subscription email templates
    MGSUB_WELCOME_SUBJECT = 'Welcome to my list!' # Defaults to: Welcome!
    MGSUB_WELCOME_TEMPLATE = 'myapp/welcome.html' # HTML template
    MGSUB_WELCOME_TEMPLATE_PLAIN = 'myapp/w.txt'  # Plain text template

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django-mgsub-0.1.2.tar.gz (21.7 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

django_mgsub-0.1.2-py3-none-any.whl (12.6 kB view details)

Uploaded Python 3

django_mgsub-0.1.2-py2-none-any.whl (12.6 kB view details)

Uploaded Python 2

File details

Details for the file django-mgsub-0.1.2.tar.gz.

File metadata

  • Download URL: django-mgsub-0.1.2.tar.gz
  • Upload date:
  • Size: 21.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for django-mgsub-0.1.2.tar.gz
Algorithm Hash digest
SHA256 f6fffc6d52ed8bedab6d9858db7423f7ddae70f2f8faea1a1a56853f7fdf056e
MD5 2dbe69625bd8c2b86af60b27a4bf7711
BLAKE2b-256 9bd3f046aea9fae1e2a93f93ca3a55364b42800a719794dd220b3fe448bd6365

See more details on using hashes here.

File details

Details for the file django_mgsub-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for django_mgsub-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 4b37b4f35f5f98c65877741f4045c22530908c772e0827fbc7efa6b4676135bf
MD5 c0287e69df71dcdb29fea3e5ded082c6
BLAKE2b-256 0a0372a38fd3e3d2a88afe688c904c99fdaf172584a710b3c3af7adb1f9b5770

See more details on using hashes here.

File details

Details for the file django_mgsub-0.1.2-py2-none-any.whl.

File metadata

File hashes

Hashes for django_mgsub-0.1.2-py2-none-any.whl
Algorithm Hash digest
SHA256 b8499252d4596ebacc329a12c65c0fd537b629be730ebfecf5fc2ab514ed0672
MD5 cd9cab275ed05346df96b6b5e29be9b8
BLAKE2b-256 7a0813b7921abf2824cfee90cb1f34380f94e20ea270330463af482191e54d01

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page