diff --git a/sspromotions/jinja2/sspromotions/email/bulletin.html b/sspromotions/jinja2/sspromotions/email/bulletin.html
index 2f1fc63..fcdf787 100644
--- a/sspromotions/jinja2/sspromotions/email/bulletin.html
+++ b/sspromotions/jinja2/sspromotions/email/bulletin.html
@@ -90,15 +90,18 @@
More from MUMUS:
{{ gap }}
-
- {% for item in more %}
-
- {% if item.image %}{% if item.link %}{% endif %} {% if item.link %}{% endif %} {% endif %}
- {{ item.title }}
- {{ item.content }}
- {% if item.link %}Read more › {% endif %}
- |
- {% endfor %}
+
+
{% endif %}
{% endblock content %}
diff --git a/sspromotions/utils.py b/sspromotions/utils.py
index 7958f39..cd68720 100644
--- a/sspromotions/utils.py
+++ b/sspromotions/utils.py
@@ -64,11 +64,28 @@ def bulletin_args(member, groups, events, bulbegin, bulend):
'bulletin_items': items
})
+ more = []
+ all_groups = models.Group.objects.all()
+ for group in all_groups:
+ if group in groups:
+ continue
+ if not group.subscribable:
+ continue
+
+ for item in group.bulletinitem_set.filter(date__gte=bulbegin).filter(date__lt=bulend).all():
+ # Check also_limit
+ # Allow matching across all groups, but only subscribable ones
+ if member is None or len(item.also_limit) == 0 or any(any(g.id == x and g.subscribable for g in all_groups) for x in item.also_limit):
+ more.append(item)
+
+ if len(more) >= 3:
+ break
+
return {
'member': member,
'events': events,
'groups': groups_data,
- 'more': [], # TODO
+ 'more': more,
'bulbegin': bulbegin,
'bulend': bulend
}