Skip to content
Snippets Groups Projects
Commit 791fd15f authored by Mario Tsatsev's avatar Mario Tsatsev
Browse files

Merge branch 'fix/newsletter-notification' into 'master'

Fix users set to newsletter push notification

See merge request !1530
parents 3906eee9 713579a6
No related branches found
No related tags found
Loading
......@@ -5,6 +5,7 @@ from django.template.loader import get_template
from django.utils import translation, timezone
from events.models import Event
from members.models import Member
from newsletters import emails
from partners.models import Partner
from pushnotifications.models import Message, Category
......@@ -67,11 +68,13 @@ def send_newsletter(newsletter):
emails.send_newsletter(newsletter)
newsletter.sent = True
newsletter.save()
Message.objects.create(
message = Message.objects.create(
title_nl=newsletter.title_nl,
title_en=newsletter.title_en,
body_nl="Tik om te bekijken",
body_en="Tap to view",
url=settings.BASE_URL + newsletter.get_absolute_url(),
category=Category.objects.get(key=Category.NEWSLETTER),
).send()
)
message.users.set(Member.current_members.all())
message.send()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment