Add unsub link to newsletters (#1455)

* Add unsub link to newsletters

* Remove debug statement

* Updated unsub link

* Update unsub style

* Format

Co-authored-by: Adrià Casajús <adria.casajus@proton.ch>
This commit is contained in:
Adrià Casajús 2022-11-28 15:08:46 +01:00 committed by GitHub
parent 363a9932f1
commit 53ef99562c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 0 deletions

View File

@ -30,7 +30,9 @@ def send_newsletter_to_user(newsletter, user) -> (bool, str):
html_template.render(
user=user,
URL=URL,
unsubscribe_link=unsubscribe_link,
),
unsubscribe_link=unsubscribe_link,
)
NewsletterUser.create(newsletter_id=newsletter.id, user_id=user.id, commit=True)

View File

@ -0,0 +1,12 @@
{% extends "base.html" %}
{% block footer %}
<p class="f-fallback sub align-center"
style="font-size: 13px;
line-height: 1.625;
text-align: center;
margin: .4em 0 1.1875em;">
<a href="{{ unsubscribe_link }}">Unsubscribe from our newsletter</a>
</p>
{% endblock %}