summaryrefslogtreecommitdiff
path: root/scripts/mails.py
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/mails.py')
-rw-r--r--scripts/mails.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/scripts/mails.py b/scripts/mails.py
index 7b7769c..e657bc2 100644
--- a/scripts/mails.py
+++ b/scripts/mails.py
@@ -11,11 +11,15 @@ from django.template import loader
from django.contrib.auth.models import User
-def textbook_workshop_remainder(subject_template=None, body_template=None):
+def textbook_workshop_remainder(subject_template=None, body_template=None,
+ user_filter = None):
"""Sends a mail to each delegate about the template content specified.
"""
- users = User.objects.all()
+ if user_filter:
+ users = User.objects.filter(**user_filter)
+ else:
+ users = User.objects.all()
subject = loader.render_to_string(subject_template).strip(' \n\t')