diff --git a/clevercloud/cron.json b/clevercloud/cron.json index f4f051f25..c2823e66f 100644 --- a/clevercloud/cron.json +++ b/clevercloud/cron.json @@ -4,6 +4,7 @@ "0 5 * * * $ROOT/clevercloud/collect_daily_matomo_stats.sh", "5 5 1 * * $ROOT/clevercloud/collect_monthly_matomo_stats.sh", "5 7-21 * * * $ROOT/clevercloud/send_notifs_when_first_reply.sh", + "5 19 * * * $ROOT/clevercloud/send_notifs_when_following_replies.sh", "10 6-22 * * * $ROOT/clevercloud/add_user_to_list_when_register.sh", "30 13 * * 1 $ROOT/clevercloud/send_notifs_on_unanswered_topics_list.sh 8", "30 13 * * 2 $ROOT/clevercloud/send_notifs_on_unanswered_topics_list.sh 9", diff --git a/clevercloud/send_notifs_when_following_replies.sh b/clevercloud/send_notifs_when_following_replies.sh new file mode 100755 index 000000000..0dc3b0c30 --- /dev/null +++ b/clevercloud/send_notifs_when_following_replies.sh @@ -0,0 +1,18 @@ +#!/bin/bash -l + +# Collect Daily Matomo Stats + +# +# About clever cloud cronjobs: +# https://www.clever-cloud.com/doc/tools/crons/ +# + +if [[ "$INSTANCE_NUMBER" != "0" ]]; then + echo "Instance number is ${INSTANCE_NUMBER}. Stop here." + exit 0 +fi + +# $APP_HOME is set by default by clever cloud. +cd $APP_HOME + +python manage.py send_notifs_when_following_replies diff --git a/lacommunaute/notification/management/commands/send_notifs_when_following_replies.py b/lacommunaute/notification/management/commands/send_notifs_when_following_replies.py new file mode 100644 index 000000000..22e67b1bc --- /dev/null +++ b/lacommunaute/notification/management/commands/send_notifs_when_following_replies.py @@ -0,0 +1,11 @@ +from django.core.management.base import BaseCommand + +from lacommunaute.notification.tasks import send_notifs_on_following_replies + + +class Command(BaseCommand): + help = "Envoyer une notification par email à l'auteur d'un sujet quand il y a de nouvelles réponses" + + def handle(self, *args, **options): + send_notifs_on_following_replies() + self.stdout.write(self.style.SUCCESS("That's all, folks!"))