diff --git a/kfet/management/commands/sendrappelsnegatifs.py b/kfet/management/commands/sendrappelsnegatifs.py index 7ff0be20..58c47d4e 100644 --- a/kfet/management/commands/sendrappelsnegatifs.py +++ b/kfet/management/commands/sendrappelsnegatifs.py @@ -31,11 +31,11 @@ class Command(BaseCommand): .filter(last_rappel__lt=now - periodic_delay) .all() ) - for account in accounts_first_mail: - account.send_rappel() - self.stdout.write("Mail de rappel pour %s envoyé avec succès." % account) - for account in accounts_periodic_mail: - account.send_rappel() - self.stdout.write("Mail de rappel pour %s envoyé avec succès." % account) + for neg in accounts_first_mail: + neg.send_rappel() + self.stdout.write(f"Mail de rappel pour {neg.account} envoyé avec succès.") + for neg in accounts_periodic_mail: + neg.send_rappel() + self.stdout.write("Mail de rappel pour {neg.account} envoyé avec succès.") if (not accounts_first_mail) and (not accounts_periodic_mail): self.stdout.write("Aucun mail à envoyer.") diff --git a/kfet/models.py b/kfet/models.py index b8b4a445..7a0ec777 100644 --- a/kfet/models.py +++ b/kfet/models.py @@ -302,7 +302,11 @@ class AccountNegative(models.Model): "Compte K-Psul négatif", loader.render_to_string( "kfet/mails/rappel.txt", - context={"account": self.account, "start_date": self.start}, + context={ + "account": self.account, + "neg_amount": -self.account.balance, + "start_date": self.start, + }, ), settings.MAIL_DATA["rappel_negatif"]["FROM"], [self.account.email], diff --git a/kfet/templates/kfet/mails/rappel.txt b/kfet/templates/kfet/mails/rappel.txt index 438ac68f..b37b2b0e 100644 --- a/kfet/templates/kfet/mails/rappel.txt +++ b/kfet/templates/kfet/mails/rappel.txt @@ -1,8 +1,8 @@ Bonjour {{ account.first_name }}, -Nous te rappelons que tu es en négatif de {{ account.balance }}€ depuis le {{ start_date }}. +Nous te rappelons que tu es en négatif de {{ neg_amount }}€ depuis le {{ start_date }}. N'oublie pas de régulariser ta situation au plus vite. En espérant te revoir très bientôt, -- -L'équipe K-Fêt \ No newline at end of file +L'équipe K-Fêt