Removed None option for mail service

* This is necessary in order to be compatible with Django-allauth
This commit is contained in:
Andrew-Chen-Wang 2020-02-06 18:41:30 -05:00
parent fecf9e0037
commit 0621929cd2
2 changed files with 12 additions and 12 deletions

View File

@ -34,7 +34,7 @@
"None"
],
"mail_service": [
"{% if cookiecutter.cloud_provider == 'AWS' %}Amazon SES{% else %}None{% endif %}",
"{% if cookiecutter.cloud_provider == 'AWS' %}Amazon SES{% else %}Plain/Vanilla Django-Anymail{% endif %}",
"Mailgun",
"Mailjet",
"Mandrill",
@ -42,8 +42,7 @@
"Sendgrid",
"SendinBlue",
"SparkPost",
"Plain/Vanilla Django-Anymail",
"None"
"Plain/Vanilla Django-Anymail"
],
"use_drf": "n",
"custom_bootstrap_compilation": "n",

View File

@ -188,59 +188,60 @@ ADMIN_URL = env("DJANGO_ADMIN_URL")
INSTALLED_APPS += ["anymail"] # noqa F405
{%- if cookiecutter.mail_service == 'Amazon SES' %}
EMAIL_BACKEND = "anymail.backends.amazon_ses.EmailBackend"
# https://anymail.readthedocs.io/en/stable/esps/amazon_ses/
{%- elif cookiecutter.mail_service == 'Mailgun' %}
EMAIL_BACKEND = "anymail.backends.mailgun.EmailBackend"
# https://anymail.readthedocs.io/en/stable/esps/mailgun/
{%- elif cookiecutter.mail_service == 'Mailjet' %}
EMAIL_BACKEND = "anymail.backends.mailjet.EmailBackend"
# https://anymail.readthedocs.io/en/stable/esps/mailjet/
{%- elif cookiecutter.mail_service == 'Mandrill' %}
EMAIL_BACKEND = "anymail.backends.mandrill.EmailBackend"
# https://anymail.readthedocs.io/en/stable/esps/mandrill/
{%- elif cookiecutter.mail_service == 'Postmark' %}
EMAIL_BACKEND = "anymail.backends.postmark.EmailBackend"
# https://anymail.readthedocs.io/en/stable/esps/postmark/
{%- elif cookiecutter.mail_service == 'Sendgrid' %}
EMAIL_BACKEND = "anymail.backends.sendgrid.EmailBackend"
# https://anymail.readthedocs.io/en/stable/esps/sendgrid/
{%- elif cookiecutter.mail_service == 'SendinBlue' %}
EMAIL_BACKEND = "anymail.backends.sendinblue.EmailBackend"
# https://anymail.readthedocs.io/en/stable/esps/sendinblue/
{%- elif cookiecutter.mail_service == 'SparkPost' %}
EMAIL_BACKEND = "anymail.backends.sparkpost.EmailBackend"
# https://anymail.readthedocs.io/en/stable/esps/sparkpost/
{%- elif cookiecutter.mail_service == 'Plain/Vanilla Django-Anymail' %}
EMAIL_BACKEND = "django.core.mail.backends.smtp.EmailBackend"
# https://docs.djangoproject.com/en/3.0/ref/settings/#email-backend
{%- endif %}
# https://anymail.readthedocs.io/en/stable/installation/#anymail-settings-reference
ANYMAIL = {
{%- if cookiecutter.mail_service == 'Mailgun' %}
{%- if cookiecutter.mail_service == 'Amazon SES' %}
# https://anymail.readthedocs.io/en/stable/esps/amazon_ses/
{%- elif cookiecutter.mail_service == 'Mailgun' %}
"MAILGUN_API_KEY": env("MAILGUN_API_KEY"),
"MAILGUN_SENDER_DOMAIN": env("MAILGUN_DOMAIN"),
"MAILGUN_API_URL": env("MAILGUN_API_URL", default="https://api.mailgun.net/v3"),
# https://anymail.readthedocs.io/en/stable/esps/mailgun/
{%- elif cookiecutter.mail_service == 'Mailjet' %}
"MAILJET_API_KEY": env("MAILJET_API_KEY"),
"MAILJET_SECRET_KEY": env("MAILJET_SECRET_KEY"),
"MAILJET_API_URL": env("MAILJET_API_URL", default="https://api.mailjet.com/v3"),
# https://anymail.readthedocs.io/en/stable/esps/mailjet/
{%- elif cookiecutter.mail_service == 'Mandrill' %}
"MANDRILL_API_KEY": env("MANDRILL_API_KEY"),
"MANDRILL_API_URL": env("MANDRILL_API_URL", default="https://mandrillapp.com/api/1.0"),
# https://anymail.readthedocs.io/en/stable/esps/mandrill/
{%- elif cookiecutter.mail_service == 'Postmark' %}
"POSTMARK_SERVER_TOKEN": env("POSTMARK_SERVER_TOKEN"),
"POSTMARK_API_URL": env("POSTMARK_API_URL", default="https://api.postmarkapp.com/"),
# https://anymail.readthedocs.io/en/stable/esps/postmark/
{%- elif cookiecutter.mail_service == 'Sendgrid' %}
"SENDGRID_API_KEY": env("SENDGRID_API_KEY"),
"SENDGRID_GENERATE_MESSAGE_ID": env("SENDGRID_GENERATE_MESSAGE_ID"),
"SENDGRID_MERGE_FIELD_FORMAT": env("SENDGRID_MERGE_FIELD_FORMAT"),
"SENDGRID_API_URL": env("SENDGRID_API_URL", default="https://api.sendgrid.com/v3/"),
# https://anymail.readthedocs.io/en/stable/esps/sendgrid/
{%- elif cookiecutter.mail_service == 'SendinBlue' %}
"SENDINBLUE_API_KEY": env("SENDINBLUE_API_KEY"),
"SENDINBLUE_API_URL": env("SENDINBLUE_API_URL", default="https://api.sendinblue.com/v3/"),
# https://anymail.readthedocs.io/en/stable/esps/sendinblue/
{%- elif cookiecutter.mail_service == 'SparkPost' %}
"SPARKPOST_API_KEY": env("SPARKPOST_API_KEY"),
"SPARKPOST_API_URL": env("SPARKPOST_API_URL", default="https://api.sparkpost.com/api/v1"),
# https://anymail.readthedocs.io/en/stable/esps/sparkpost/
{%- endif %}
}