diff --git a/lemarche/tenders/management/commands/send_siae_transactioned_question_emails.py b/lemarche/tenders/management/commands/send_siae_transactioned_question_emails.py index b2fc622bf..2a9feb681 100644 --- a/lemarche/tenders/management/commands/send_siae_transactioned_question_emails.py +++ b/lemarche/tenders/management/commands/send_siae_transactioned_question_emails.py @@ -13,9 +13,7 @@ class Command(BaseCommand): """ Daily script to send an email to tender siaes Rules - - Tender must be "sent" - - Siae must be "interested" - - Siae must not have received a survey yet + - Tender must be "sent" + no info on "transactioned" When? - J+7 after tender start_working_date @@ -31,8 +29,9 @@ def add_arguments(self, parser): def handle(self, kind=None, reminder=False, dry_run=False, **options): self.stdout.write("Script to send email tender transactioned_question to interested siaes...") - # tender must be sent & start_working_date J+7 - tender_qs = Tender.objects.sent().filter(start_working_date=seven_days_ago) + # tender must be sent & no info on transaction & start_working_date J+7 + tender_qs = Tender.objects.sent().filter(siae_transactioned=None) + tender_qs = tender_qs.filter(start_working_date=seven_days_ago) self.stdout.write(f"Found {tender_qs.count()} tenders") diff --git a/lemarche/www/tenders/tasks.py b/lemarche/www/tenders/tasks.py index d22b83fb8..d45000da5 100644 --- a/lemarche/www/tenders/tasks.py +++ b/lemarche/www/tenders/tasks.py @@ -643,7 +643,7 @@ def send_tenders_siae_survey(tendersiae: TenderSiae, kind="transactioned_questio # add timestamp tendersiae.survey_transactioned_send_date = timezone.now() - api_mailjet.send_transactional_email_many_recipient_with_template( + api_mailjet.send_transactional_email_with_template( template_id=template_id, subject=email_subject, recipient_email=recipient_email,