From 50b00e5b6d7bb02b779d7c7886b7571fcb1be5f3 Mon Sep 17 00:00:00 2001 From: michail Date: Mon, 30 Sep 2019 12:10:45 +0500 Subject: [PATCH] added news mail template and task without celery delay --- project/settings/base.py | 1 + project/templates/news/news_email.html | 20 ++++++++++++++++++++ project/urls/web.py | 2 +- 3 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 project/templates/news/news_email.html diff --git a/project/settings/base.py b/project/settings/base.py index cfea18a5..719b637b 100644 --- a/project/settings/base.py +++ b/project/settings/base.py @@ -397,6 +397,7 @@ PASSWORD_RESET_TIMEOUT_DAYS = 1 RESETTING_TOKEN_TEMPLATE = 'account/password_reset_email.html' CHANGE_EMAIL_TEMPLATE = 'account/change_email.html' CONFIRM_EMAIL_TEMPLATE = 'authorization/confirm_email.html' +NEWS_EMAIL_TEMPLATE = "news/news_email.html" # COOKIES diff --git a/project/templates/news/news_email.html b/project/templates/news/news_email.html new file mode 100644 index 00000000..c9669829 --- /dev/null +++ b/project/templates/news/news_email.html @@ -0,0 +1,20 @@ + + + + + {{ title }} + + +

{{ title }}

+ + {% if subtitle %} +

{{ subtitle }}

+ {% endif %} + +

{{ description }}

+ +https://{{ domain_uri }}{% url 'web:notification:unsubscribe' code %} + + + + diff --git a/project/urls/web.py b/project/urls/web.py index 0a81672d..5bf538f3 100644 --- a/project/urls/web.py +++ b/project/urls/web.py @@ -23,7 +23,7 @@ urlpatterns = [ path('collections/', include('collection.urls.web')), path('establishments/', include('establishment.urls.web')), path('news/', include('news.urls.web')), - path('notifications/', include('notification.urls.web')), + path('notifications/', include(('notification.urls.web', "notification"), namespace='notification')), path('partner/', include('partner.urls.web')), path('location/', include('location.urls.web')), path('main/', include('main.urls')),