Skip to content

Commit

Permalink
Replace 30d by 7d
Browse files Browse the repository at this point in the history
  • Loading branch information
raphodn committed Nov 23, 2023
1 parent 1130b8f commit 3f43f73
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions config/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -384,8 +384,8 @@
"MAILJET_TENDERS_AUTHOR_INCREMENTAL_2D_TEMPLATE_ID", 4585824
)
MAILJET_TENDERS_AUTHOR_FEEDBACK_30D_TEMPLATE_ID = env.int("MAILJET_TENDERS_AUTHOR_FEEDBACK_30D_TEMPLATE_ID", 4017446)
MAILJET_TENDERS_AUTHOR_TRANSACTIONED_QUESTION_30D_TEMPLATE_ID = env.int(
"MAILJET_TENDERS_AUTHOR_TRANSACTIONED_QUESTION_30D_TEMPLATE_ID", 5207181
MAILJET_TENDERS_AUTHOR_TRANSACTIONED_QUESTION_7D_TEMPLATE_ID = env.int(
"MAILJET_TENDERS_AUTHOR_TRANSACTIONED_QUESTION_7D_TEMPLATE_ID", 5207181
) # 4951625


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def handle(self, kind=None, dry_run=False, is_all_tenders=False, **options):

if not dry_run:
for tender in tender_qs:
send_tenders_author_feedback_or_survey(tender, kind="transactioned_question")
send_tenders_author_feedback_or_survey(tender, kind="transactioned_question_7d")
self.stdout.write(f"Sent {tender_qs.count()} J+30 feedbacks")

self.stdout.write("-" * 80)
Expand Down
8 changes: 4 additions & 4 deletions lemarche/www/tenders/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -490,7 +490,7 @@ def send_author_incremental_2_days_email(tender: Tender):
tender.save()


def send_tenders_author_feedback_or_survey(tender: Tender, kind="feedback"):
def send_tenders_author_feedback_or_survey(tender: Tender, kind="feedback_30d"):
email_subject = f"Suite à votre {tender.get_kind_display().lower()}"
recipient_list = whitelist_recipient_list([tender.author.email])
if recipient_list:
Expand All @@ -504,8 +504,8 @@ def send_tenders_author_feedback_or_survey(tender: Tender, kind="feedback"):
"TENDER_KIND": tender.get_kind_display(),
}

if kind == "transactioned_question":
template_id = settings.MAILJET_TENDERS_AUTHOR_TRANSACTIONED_QUESTION_30D_TEMPLATE_ID
if kind == "transactioned_question_7d":
template_id = settings.MAILJET_TENDERS_AUTHOR_TRANSACTIONED_QUESTION_7D_TEMPLATE_ID
user_sesame_query_string = sesame_get_query_string(tender.author) # TODO: sesame scope parameter
answer_url_with_sesame_token = (
f"https://{get_domain_url()}"
Expand All @@ -529,7 +529,7 @@ def send_tenders_author_feedback_or_survey(tender: Tender, kind="feedback"):

# log email
log_item = {
"action": f"email_{kind}_30d_sent",
"action": f"email_{kind}_sent",
"email_to": recipient_email,
"email_subject": email_subject,
# "email_body": email_body,
Expand Down
2 changes: 1 addition & 1 deletion lemarche/www/tenders/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -1173,7 +1173,7 @@ def test_user_can_notify_cocontracting_wish(self):

# def test_send_email_for_feedbacks_set_log(self):
# self.assertEqual(len(self.tender.logs), 0)
# send_tenders_author_feedback_or_survey(self.tender, kind="feedback")
# send_tenders_author_feedback_or_survey(self.tender, kind="feedback_30d")
# # fetch tender to be sure to have the last version of tender
# tender: Tender = Tender.objects.get(pk=self.tender.pk)
# self.assertEqual(len(tender.logs), 1)
Expand Down

0 comments on commit 3f43f73

Please sign in to comment.