Self hosted FLOSS fitness/workout, nutrition and weight tracker
Small reworking of weight reminder emails
Roland Geider61fc1cd4e815
diff --git a/wger/core/models.py b/wger/core/models.pyindex 56b018e84..4445b04e5 100644--- a/wger/core/models.py+++ b/wger/core/models.py@@ -310,7 +310,7 @@ by the US Department of Agriculture. It is extremely complete, with around'deactivate)'),max_length=30,default=0)- ''' Number of Days Reminder Weight '''+ '''Number of Days for email weight reminder'''@propertydef weight(self):diff --git a/wger/manager/management/commands/email-weight-reminder.py b/wger/manager/management/commands/email-weight-reminder.pyindex 4521582b7..97394fea8 100644--- a/wger/manager/management/commands/email-weight-reminder.py+++ b/wger/manager/management/commands/email-weight-reminder.py@@ -53,12 +53,12 @@ class Command(BaseCommand):datediff = (today - last_entry).daysif datediff >= profile.num_days_weight_reminder:- self.send_email(profile.user, last_entry)+ self.send_email(profile.user, last_entry, datediff)except WeightEntry.DoesNotExist:pass@staticmethod- def send_email(user, last_entry):+ def send_email(user, last_entry, datediff):'''Notify a user to input the weight entry@@ -71,7 +71,8 @@ class Command(BaseCommand):context = {}context['site'] = Site.objects.get_current()- context['day'] = last_entry+ context['date'] = last_entry+ context['days'] = datediffsubject = _('You have to enter your weight')message = loader.render_to_string('workout/email_weight_reminder.tpl', context)diff --git a/wger/manager/templates/workout/email_reminder.tpl b/wger/manager/templates/workout/email_reminder.tplindex 36dea94f7..6eb6aa8d9 100644--- a/wger/manager/templates/workout/email_reminder.tpl+++ b/wger/manager/templates/workout/email_reminder.tpl@@ -8,8 +8,9 @@{% blocktrans %}You will regularly receive such reminders till you add a new workout.Alternatively you can add workouts to a loop schedule, such schedules-never produce reminders. If you don't want to ever receive email-reminders, deactivate the option in your settings.{% endblocktrans %}+never produce reminders.{% endblocktrans %}+{% blocktrans %}If you don't want to ever receive email reminders, deactivate the+option in your settings.{% endblocktrans %}{% trans "the wger.de team" %}diff --git a/wger/manager/templates/workout/email_weight_reminder.tpl b/wger/manager/templates/workout/email_weight_reminder.tplindex fbf654827..65075c85b 100644--- a/wger/manager/templates/workout/email_weight_reminder.tpl+++ b/wger/manager/templates/workout/email_weight_reminder.tpl@@ -1,12 +1,13 @@{% spaceless %}{% load i18n %}-{% blocktrans %}Your last weight entry is from {{day}}. Please click the link above to access wger and update this information. {% endblocktrans %}+{% blocktrans %}Your last weight entry is from {{date}} ({{days}} days ago).+Please click the link to access the application and enter a new one.{% endblocktrans %}{% endspaceless %}-{% blocktrans %}You will regularly receive such reminders till you entry your weight.-If you don't want to ever receive email-reminders, deactivate the option in your settings.{% endblocktrans %}+{% blocktrans %}You will regularly receive such reminders till you enter your current weight.{% endblocktrans %}+{% blocktrans %}If you don't want to ever receive email reminders, deactivate the+option in your settings.{% endblocktrans %}{% trans "the wger.de team" %}