Merge branch 'feature/news-subscription' into develop

This commit is contained in:
Kuroshini 2020-01-13 15:38:16 +03:00
commit f93337def3
2 changed files with 5 additions and 7 deletions

View File

@ -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'))
@ -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 '#',
@ -55,7 +54,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'))
@ -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 '#',

View File

@ -59,7 +59,7 @@
</div>
<div class="letter__unsubscribe" style="margin: 0 0 1.25rem;font-size: 12px;text-align: center;">
<span class="letter__unsubscribe-dscr" style="display: inline-block;">This email has been sent to {{ send_to }} ,</span>
<a href="https://{{ country_code }}.{{ domain_uri }}{% url 'web:notification:unsubscribe' code %}" target="_blank" style="color: #000;font-weight: 700;text-decoration: none;padding: 0;border-bottom: 1.5px solid #ffee29;cursor: pointer;">click here to unsubscribe</a>
<a href="{{ link_to_unsubscribe }}" target="_blank" style="color: #000;font-weight: 700;text-decoration: none;padding: 0;border-bottom: 1.5px solid #ffee29;cursor: pointer;">click here to unsubscribe</a>
</div>
<div class="letter__footer" style="padding: 24px 0 15px;text-align: center;background: #ffee29;">
<div class="letter__footer-logo" style="width: 71px;height: 42px;margin: 0 auto 14px auto;">