From 3506f6b2f0daba3881e676253312a71bc8c19ee2 Mon Sep 17 00:00:00 2001 From: dormantman Date: Mon, 13 Jan 2020 14:34:11 +0300 Subject: [PATCH 1/2] Change templates --- apps/notification/tasks.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/notification/tasks.py b/apps/notification/tasks.py index f2e4ccc3..f5261a82 100644 --- a/apps/notification/tasks.py +++ b/apps/notification/tasks.py @@ -15,7 +15,7 @@ def send_subscribes_update_email(subscriber_id): country_code = subscriber.country_code - html_template = get_template(settings.NEWS_EMAIL_TEMPLATE) + html_template = get_template(settings.NOTIFICATION_SUBSCRIBE_TEMPLATE) year = datetime.now().year socials = list(SiteSettings.objects.with_country().select_related('country')) @@ -55,7 +55,7 @@ def send_unsubscribe_email(subscriber_id): country_code = subscriber.country_code - html_template = get_template(settings.NEWS_EMAIL_TEMPLATE) + html_template = get_template(settings.NOTIFICATION_SUBSCRIBE_TEMPLATE) year = datetime.now().year socials = list(SiteSettings.objects.with_country().select_related('country')) From fdb08923777828f522a940ee5e6a64add6ee48bf Mon Sep 17 00:00:00 2001 From: dormantman Date: Mon, 13 Jan 2020 15:32:40 +0300 Subject: [PATCH 2/2] Update unsubscribe url --- apps/notification/tasks.py | 6 ++---- project/templates/notification/update_email.html | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/apps/notification/tasks.py b/apps/notification/tasks.py index f5261a82..38b11cd5 100644 --- a/apps/notification/tasks.py +++ b/apps/notification/tasks.py @@ -30,8 +30,7 @@ def send_subscribes_update_email(subscriber_id): for name in subscriber.subscription_types.values_list('name', flat=True) ]), "code": subscriber.update_code, - "domain_uri": settings.DOMAIN_URI, - "country_code": subscriber.country_code, + "link_to_unsubscribe": subscriber.link_to_unsubscribe, "twitter_page_url": socials_for_subscriber.twitter_page_url if socials_for_subscriber else '#', "instagram_page_url": socials_for_subscriber.instagram_page_url if socials_for_subscriber else '#', "facebook_page_url": socials_for_subscriber.facebook_page_url if socials_for_subscriber else '#', @@ -67,8 +66,7 @@ def send_unsubscribe_email(subscriber_id): "title": "You have successfully unsubscribed from G&M news", "description": "", "code": subscriber.update_code, - "domain_uri": settings.DOMAIN_URI, - "country_code": subscriber.country_code, + "link_to_unsubscribe": subscriber.link_to_unsubscribe, "twitter_page_url": socials_for_subscriber.twitter_page_url if socials_for_subscriber else '#', "instagram_page_url": socials_for_subscriber.instagram_page_url if socials_for_subscriber else '#', "facebook_page_url": socials_for_subscriber.facebook_page_url if socials_for_subscriber else '#', diff --git a/project/templates/notification/update_email.html b/project/templates/notification/update_email.html index dad6e9b8..0b4444c2 100644 --- a/project/templates/notification/update_email.html +++ b/project/templates/notification/update_email.html @@ -59,7 +59,7 @@
This email has been sent to {{ send_to }} , - click here to unsubscribe + click here to unsubscribe