From 422094a24096db0e85da0230aea3205ad68a66f6 Mon Sep 17 00:00:00 2001 From: Benni Baermann Date: Mon, 26 Oct 2020 13:01:11 +0100 Subject: [PATCH] send mails 4 weeks after project end reached --- input/management/commands/sendmails.py | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/input/management/commands/sendmails.py b/input/management/commands/sendmails.py index 3a1621e..8fa133f 100644 --- a/input/management/commands/sendmails.py +++ b/input/management/commands/sendmails.py @@ -100,9 +100,22 @@ class Command(BaseCommand): item.save() def surveymails_to_project(self): - pass - + '''send survey link 4 weeks after end of project reached''' + supported = Project.objects.filter(granted=True)\ + .filter(granted_date__lt = date.today() - timedelta(days=28))\ + .exclude(survey_mail_send=True) + print(supported) + for item in supported: + self.survey_link(email=item.email, + type='PRO', + pid=9999, ## TODO + name=item.name, + realname=item.realname) + item.survey_mail_send = True + item.save() + def surveymails_to_travel(self): + '''send survey link 3 weeks after end of project reached''' pass