Updated mail service docs

* Trying to appease the Black-linter god...
This commit is contained in:
Andrew-Chen-Wang 2020-02-06 20:18:49 -05:00
parent 0621929cd2
commit ac884f3f75
4 changed files with 69 additions and 9 deletions

View File

@ -46,7 +46,7 @@ Features
* Registration via django-allauth_ * Registration via django-allauth_
* Comes with custom user model ready to go * Comes with custom user model ready to go
* Optional custom static build using Gulp and livereload * Optional custom static build using Gulp and livereload
* Send emails via Anymail_ (using Mailgun_ by default, but switchable) * Send emails via Anymail_ (using Mailgun_ by default or Amazon SES if AWS is selected cloud provider, but switchable)
* Media storage using Amazon S3 or Google Cloud Storage * Media storage using Amazon S3 or Google Cloud Storage
* Docker support using docker-compose_ for development and production (using Traefik_ with LetsEncrypt_ support) * Docker support using docker-compose_ for development and production (using Traefik_ with LetsEncrypt_ support)
* Procfile_ for deploying to Heroku * Procfile_ for deploying to Heroku

View File

@ -70,6 +70,19 @@ cloud_provider:
Note that if you choose no cloud provider, media files won't work. Note that if you choose no cloud provider, media files won't work.
mail_service:
Select an email service that Django-Anymail provides
1. Amazon SES_
2. Mailgun_
3. Mailjet_
4. Mandrill_
5. Postmark_
6. SendGrid_
7. SendinBlue_
8. SparkPost_
9. Plain/Vanilla Django-Anymail_
use_drf: use_drf:
Indicates whether the project should be configured to use `Django Rest Framework`_. Indicates whether the project should be configured to use `Django Rest Framework`_.
@ -132,6 +145,16 @@ debug:
.. _AWS: https://aws.amazon.com/s3/ .. _AWS: https://aws.amazon.com/s3/
.. _GCP: https://cloud.google.com/storage/ .. _GCP: https://cloud.google.com/storage/
.. _SES: https://aws.amazon.com/ses/
.. _Mailgun: https://www.mailgun.com
.. _Mailjet: https://www.mailjet.com
.. _Mandrill: http://mandrill.com
.. _Postmark: https://postmarkapp.com
.. _SendGrid: https://sendgrid.com
.. _SendinBlue: https://www.sendinblue.com
.. _SparkPost: https://www.sparkpost.com
.. _Django-Anymail: https://anymail.readthedocs.io/en/stable/
.. _Django Rest Framework: https://github.com/encode/django-rest-framework/ .. _Django Rest Framework: https://github.com/encode/django-rest-framework/
.. _Django Compressor: https://github.com/django-compressor/django-compressor .. _Django Compressor: https://github.com/django-compressor/django-compressor

View File

@ -52,6 +52,21 @@ DJANGO_SENTRY_LOG_LEVEL SENTRY_LOG_LEVEL n/a
MAILGUN_API_KEY MAILGUN_API_KEY n/a raises error MAILGUN_API_KEY MAILGUN_API_KEY n/a raises error
MAILGUN_DOMAIN MAILGUN_SENDER_DOMAIN n/a raises error MAILGUN_DOMAIN MAILGUN_SENDER_DOMAIN n/a raises error
MAILGUN_API_URL n/a n/a "https://api.mailgun.net/v3" MAILGUN_API_URL n/a n/a "https://api.mailgun.net/v3"
MAILJET_API_KEY MAILJET_API_KEY n/a raises error
MAILJET_SECRET_KEY MAILJET_SECRET_KEY n/a raises error
MAILJET_API_URL n/a n/a "https://api.mailjet.com/v3"
MANDRILL_API_KEY MANDRILL_API_KEY n/a raises error
MANDRILL_API_URL n/a n/a "https://mandrillapp.com/api/1.0"
POSTMARK_SERVER_TOKEN POSTMARK_SERVER_TOKEN n/a raises error
POSTMARK_API_URL n/a n/a "https://api.postmarkapp.com/"
SENDGRID_API_KEY SENDGRID_API_KEY n/a raises error
SENDGRID_GENERATE_MESSAGE_ID True n/a raises error
SENDGRID_MERGE_FIELD_FORMAT None n/a raises error
SENDGRID_API_URL n/a n/a "https://api.sendgrid.com/v3/"
SENDINBLUE_API_KEY SENDINBLUE_API_KEY n/a raises error
SENDINBLUE_API_URL n/a n/a "https://api.sendinblue.com/v3/"
SPARKPOST_API_KEY SPARKPOST_API_KEY n/a raises error
SPARKPOST_API_URL n/a n/a "https://api.sparkpost.com/api/v1"
======================================= =========================== ============================================== ====================================================================== ======================================= =========================== ============================================== ======================================================================
-------------------------- --------------------------

View File

@ -208,39 +208,61 @@ EMAIL_BACKEND = "django.core.mail.backends.smtp.EmailBackend"
{%- endif %} {%- endif %}
# https://anymail.readthedocs.io/en/stable/installation/#anymail-settings-reference # https://anymail.readthedocs.io/en/stable/installation/#anymail-settings-reference
ANYMAIL = { ANYMAIL = {
# https://anymail.readthedocs.io/en/stable/esps/
{%- if cookiecutter.mail_service == 'Amazon SES' %} {%- if cookiecutter.mail_service == 'Amazon SES' %}
# https://anymail.readthedocs.io/en/stable/esps/amazon_ses/ # https://anymail.readthedocs.io/en/stable/esps/amazon_ses/
{%- elif cookiecutter.mail_service == 'Mailgun' %} {%- elif cookiecutter.mail_service == 'Mailgun' %}
"MAILGUN_API_KEY": env("MAILGUN_API_KEY"), "MAILGUN_API_KEY": env("MAILGUN_API_KEY"),
"MAILGUN_SENDER_DOMAIN": env("MAILGUN_DOMAIN"), "MAILGUN_SENDER_DOMAIN": env("MAILGUN_DOMAIN"),
"MAILGUN_API_URL": env("MAILGUN_API_URL", default="https://api.mailgun.net/v3"), "MAILGUN_API_URL": env(
"MAILGUN_API_URL",
default="https://api.mailgun.net/v3"
),
# https://anymail.readthedocs.io/en/stable/esps/mailgun/ # https://anymail.readthedocs.io/en/stable/esps/mailgun/
{%- elif cookiecutter.mail_service == 'Mailjet' %} {%- elif cookiecutter.mail_service == 'Mailjet' %}
"MAILJET_API_KEY": env("MAILJET_API_KEY"), "MAILJET_API_KEY": env("MAILJET_API_KEY"),
"MAILJET_SECRET_KEY": env("MAILJET_SECRET_KEY"), "MAILJET_SECRET_KEY": env("MAILJET_SECRET_KEY"),
"MAILJET_API_URL": env("MAILJET_API_URL", default="https://api.mailjet.com/v3"), "MAILJET_API_URL": env(
"MAILJET_API_URL",
default="https://api.mailjet.com/v3"
),
# https://anymail.readthedocs.io/en/stable/esps/mailjet/ # https://anymail.readthedocs.io/en/stable/esps/mailjet/
{%- elif cookiecutter.mail_service == 'Mandrill' %} {%- elif cookiecutter.mail_service == 'Mandrill' %}
"MANDRILL_API_KEY": env("MANDRILL_API_KEY"), "MANDRILL_API_KEY": env("MANDRILL_API_KEY"),
"MANDRILL_API_URL": env("MANDRILL_API_URL", default="https://mandrillapp.com/api/1.0"), "MANDRILL_API_URL": env(
"MANDRILL_API_URL",
default="https://mandrillapp.com/api/1.0"
),
# https://anymail.readthedocs.io/en/stable/esps/mandrill/ # https://anymail.readthedocs.io/en/stable/esps/mandrill/
{%- elif cookiecutter.mail_service == 'Postmark' %} {%- elif cookiecutter.mail_service == 'Postmark' %}
"POSTMARK_SERVER_TOKEN": env("POSTMARK_SERVER_TOKEN"), "POSTMARK_SERVER_TOKEN": env("POSTMARK_SERVER_TOKEN"),
"POSTMARK_API_URL": env("POSTMARK_API_URL", default="https://api.postmarkapp.com/"), "POSTMARK_API_URL": env(
"POSTMARK_API_URL",
default="https://api.postmarkapp.com/"
),
# https://anymail.readthedocs.io/en/stable/esps/postmark/ # https://anymail.readthedocs.io/en/stable/esps/postmark/
{%- elif cookiecutter.mail_service == 'Sendgrid' %} {%- elif cookiecutter.mail_service == 'Sendgrid' %}
"SENDGRID_API_KEY": env("SENDGRID_API_KEY"), "SENDGRID_API_KEY": env("SENDGRID_API_KEY"),
"SENDGRID_GENERATE_MESSAGE_ID": env("SENDGRID_GENERATE_MESSAGE_ID"), "SENDGRID_GENERATE_MESSAGE_ID": env("SENDGRID_GENERATE_MESSAGE_ID"),
"SENDGRID_MERGE_FIELD_FORMAT": env("SENDGRID_MERGE_FIELD_FORMAT"), "SENDGRID_MERGE_FIELD_FORMAT": env("SENDGRID_MERGE_FIELD_FORMAT"),
"SENDGRID_API_URL": env("SENDGRID_API_URL", default="https://api.sendgrid.com/v3/"), "SENDGRID_API_URL": env(
"SENDGRID_API_URL",
default="https://api.sendgrid.com/v3/"
),
# https://anymail.readthedocs.io/en/stable/esps/sendgrid/ # https://anymail.readthedocs.io/en/stable/esps/sendgrid/
{%- elif cookiecutter.mail_service == 'SendinBlue' %} {%- elif cookiecutter.mail_service == 'SendinBlue' %}
"SENDINBLUE_API_KEY": env("SENDINBLUE_API_KEY"), "SENDINBLUE_API_KEY": env("SENDINBLUE_API_KEY"),
"SENDINBLUE_API_URL": env("SENDINBLUE_API_URL", default="https://api.sendinblue.com/v3/"), "SENDINBLUE_API_URL": env(
"SENDINBLUE_API_URL",
default="https://api.sendinblue.com/v3/"
),
# https://anymail.readthedocs.io/en/stable/esps/sendinblue/ # https://anymail.readthedocs.io/en/stable/esps/sendinblue/
{%- elif cookiecutter.mail_service == 'SparkPost' %} {%- elif cookiecutter.mail_service == 'SparkPost' %}
"SPARKPOST_API_KEY": env("SPARKPOST_API_KEY"), "SPARKPOST_API_KEY": env("SPARKPOST_API_KEY"),
"SPARKPOST_API_URL": env("SPARKPOST_API_URL", default="https://api.sparkpost.com/api/v1"), "SPARKPOST_API_URL": env(
"SPARKPOST_API_URL",
default="https://api.sparkpost.com/api/v1"
),
# https://anymail.readthedocs.io/en/stable/esps/sparkpost/ # https://anymail.readthedocs.io/en/stable/esps/sparkpost/
{%- endif %} {%- endif %}
} }