Skip to content

Commit

Permalink
Additional fixes on tendersiae contacted reminder workflow. ref #723
Browse files Browse the repository at this point in the history
  • Loading branch information
raphodn committed Apr 25, 2023
1 parent 23e9f6a commit a4b6d85
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
4 changes: 2 additions & 2 deletions clevercloud/cron.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"30 7 * * 1 $ROOT/clevercloud/siaes_update_api_entreprise_fields.sh",
"45 7 * * 1 $ROOT/clevercloud/siaes_update_api_qpv_fields.sh",
"0 8 * * 1 $ROOT/clevercloud/siaes_update_api_zrr_fields.sh",
"0 9 * * * $ROOT/clevercloud/siaes_send_user_request_reminders.sh",
"5 9 * * * $ROOT/clevercloud/tenders_send_siae_contacted_reminders.sh",
"0 9 * * * $ROOT/clevercloud/siaes_send_user_request_reminder_emails.sh",
"5 9 * * * $ROOT/clevercloud/tenders_send_siae_contacted_reminder_emails.sh",
"10 9 * * * $ROOT/clevercloud/tenders_send_author_incremental.sh"
]
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#!/bin/bash -l

# Send SiaeUserRequest reminders
# Send SiaeUserRequest reminder emails

# Do not run if this env var is not set:
if [[ -z "$CRON_SIAE_SEND_USER_REQUEST_REMINDERS_ENABLED" ]]; then
echo "CRON_SIAE_SEND_USER_REQUEST_REMINDERS_ENABLED not set. Exiting..."
if [[ -z "$CRON_SIAE_SEND_USER_REQUEST_REMINDER_EMAILS_ENABLED" ]]; then
echo "CRON_SIAE_SEND_USER_REQUEST_REMINDER_EMAILS_ENABLED not set. Exiting..."
exit 0
fi

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#!/bin/bash -l

# Send TenderSiae reminders
# Send TenderSiae contacted reminder emails

# Do not run if this env var is not set:
if [[ -z "$CRON_TENDER_SEND_SIAE_CONTACTED_REMINDERS_ENABLED" ]]; then
echo "CRON_TENDER_SEND_SIAE_CONTACTED_REMINDERS_ENABLED not set. Exiting..."
if [[ -z "$CRON_TENDER_SEND_SIAE_CONTACTED_REMINDER_EMAILS_ENABLED" ]]; then
echo "CRON_TENDER_SEND_SIAE_CONTACTED_REMINDER_EMAILS_ENABLED not set. Exiting..."
exit 0
fi

Expand Down
10 changes: 5 additions & 5 deletions lemarche/www/tenders/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,13 +168,13 @@ def send_tender_contacted_reminder_email_to_siaes(
send_tender_contacted_reminder_email_to_siae(tendersiae, email_subject, days_since_email_send_date)

# log email batch
siaes_reminder_log_item = {
"action": f"email_siaes_reminder_{days_since_email_send_date}d",
log_item = {
"action": f"email_siaes_contacted_reminder_{days_since_email_send_date}d",
"email_subject": email_subject,
"email_count": tendersiae_contacted_reminder_list.count(),
"email_timestamp": timezone.now().isoformat(),
}
tender.logs.append(siaes_reminder_log_item)
tender.logs.append(log_item)
tender.save()


Expand All @@ -193,11 +193,11 @@ def send_tender_contacted_reminder_email_to_siae(tendersiae: TenderSiae, email_s
"TENDER_KIND": tendersiae.tender.get_kind_display(),
"TENDER_SECTORS": tendersiae.tender.sectors_list_string(),
"TENDER_PERIMETERS": tendersiae.tender.location_display,
"TENDER_URL": f"{get_share_url_object(tendersiae.tender)}?siae_id={tendersiae.siae.id}&source=relance",
"TENDER_URL": f"{get_share_url_object(tendersiae.tender)}?siae_id={tendersiae.siae.id}&mtm_campaign=relance-esi-contactees", # noqa
}

api_mailjet.send_transactional_email_with_template(
template_id=settings.MAILJET_TENDERS_AUTHOR_INCREMENTAL_2D_TEMPLATE_ID,
template_id=settings.MAILJET_TENDERS_PRESENTATION_REMINDER_2D_TEMPLATE_ID,
subject=email_subject,
recipient_email=recipient_email,
recipient_name=recipient_name,
Expand Down

0 comments on commit a4b6d85

Please sign in to comment.