diff --git a/docs/source/manager/other/index.rst b/docs/source/manager/other/index.rst
index 71666c9ec6..2fd6b27163 100644
--- a/docs/source/manager/other/index.rst
+++ b/docs/source/manager/other/index.rst
@@ -28,6 +28,14 @@ Janeway lets you define your own email reminders for overdue Reviews and Revisio
- The name of the template that should be used when sending the reminder. If this template does no exist you will be asked to create it.
- Subject
- The email subject to send with the reminder.
+
+There are three types of reminder email supported by Janeway:
+
+- Review (Invited) - sent when a reviewer has been invited but not accepted a review request.
+- Review (Accepted) - sent when a reviewer has accepted a review request but not yet completed it.
+- Revision - Sent to authors with active revision requests.
+
+Review reminders, both invited and accepted, are sent based on the review assignment due date set by the editor. Revision reminders are sent based on the revision request due date set by the editor. You can set reminders to be sent either before or after the set due date.
A reminder email has access to three objects in the template:
diff --git a/src/cron/migrations/0001_initial.py b/src/cron/migrations/0001_initial.py
index 034304d776..87d9dc82fa 100755
--- a/src/cron/migrations/0001_initial.py
+++ b/src/cron/migrations/0001_initial.py
@@ -34,8 +34,23 @@ class Migration(migrations.Migration):
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('type', models.CharField(choices=[('review', 'Review'), ('revisions', 'Revision')], max_length=100)),
- ('run_type', models.CharField(choices=[('before', 'Before'), ('after', 'After')], max_length=100)),
- ('days', models.PositiveIntegerField(help_text='The number of days before or after this reminder should fire')),
+ (
+ 'run_type',
+ models.CharField(
+ choices=[
+ ('before', 'before the due date'),
+ ('after', 'after the due date')
+ ],
+ max_length=100
+ )
+ ),
+ (
+ 'days',
+ models.PositiveIntegerField(
+ help_text='The number of days before or after '
+ 'the due date this reminder should fire'
+ )
+ ),
('template_name', models.CharField(help_text='The name of the email template', max_length=100)),
('subject', models.CharField(max_length=200)),
],
diff --git a/src/cron/migrations/0004_auto_20210831_1159.py b/src/cron/migrations/0004_auto_20210831_1159.py
index c65183afa1..0759e91330 100644
--- a/src/cron/migrations/0004_auto_20210831_1159.py
+++ b/src/cron/migrations/0004_auto_20210831_1159.py
@@ -15,7 +15,13 @@ class Migration(migrations.Migration):
migrations.AlterField(
model_name='reminder',
name='template_name',
- field=models.CharField(help_text="The name of the email template, if it doesn't exist you will be asked to create it. Should have no spaces.", max_length=100),
+ field=models.CharField(
+ help_text="The name of the email template. "
+ "If it does not exist, you will be "
+ "asked to create it. "
+ "Should have no spaces.",
+ max_length=100,
+ ),
),
migrations.AlterField(
model_name='reminder',
diff --git a/src/cron/models.py b/src/cron/models.py
index cce96d73ae..562273ffea 100755
--- a/src/cron/models.py
+++ b/src/cron/models.py
@@ -81,9 +81,9 @@ def add_email_task(to, subject, html, request, article=None, run_at=timezone.now
RUN_TYPE_CHOICES = (
# Before the event
- ('before', 'Before'),
+ ('before', 'before the due date'),
# After the event
- ('after', 'After'),
+ ('after', 'after the due date'),
)
@@ -100,20 +100,37 @@ class Reminder(models.Model):
)
type = models.CharField(max_length=100, choices=REMINDER_CHOICES)
run_type = models.CharField(max_length=100, choices=RUN_TYPE_CHOICES)
- days = models.PositiveIntegerField(help_text="The number of days before or after this reminder should fire")
- template_name = models.CharField(max_length=100, help_text="The name of the email template, if it doesn't exist "
- "you will be asked to create it. Should have no spaces.")
+ days = models.PositiveIntegerField(
+ help_text="The number of days before or "
+ "after the due date this "
+ "reminder should fire",
+ )
+ template_name = models.CharField(
+ max_length=100,
+ help_text="The name of the email template. "
+ "If it does not exist, you will be "
+ "asked to create it. "
+ "Should have no spaces.",
+ )
subject = models.CharField(max_length=200)
def __str__(self):
- return "{0}: {1}, {2}, {3}".format(self.journal.code, self.run_type, self.type, self.subject)
+ return "{0}: {1}, {2}, {3}".format(
+ self.journal.code,
+ self.run_type,
+ self.type,
+ self.subject,
+ )
def target_date(self):
"""
- Works out the target date of a reminder by adding or subtracting a timedelta from today's date.
- Examples: Reminder set to send 5 days before the due date we take today's date and add 5 days to search
- for ReviewAssignments that are due 5 days from now. The reverse is true for after, we remove 5 days from
- today's date to work out which ReviewAssignments were due 5 days ago.
+ Works out the target date of a reminder by adding or subtracting a
+ timedelta from today's date.
+ Examples: For a reminder set to send 5 days before the due date,
+ we take today's date and add 5 days to search for
+ ReviewAssignments that are due 5 days from now. The reverse
+ is true for after: we remove 5 days from today's date to work
+ out which ReviewAssignments were due 5 days ago.
"""
date_time = None
diff --git a/src/templates/admin/cron/manage_reminder.html b/src/templates/admin/cron/manage_reminder.html
index c41ce94bdc..73e2a0007a 100644
--- a/src/templates/admin/cron/manage_reminder.html
+++ b/src/templates/admin/cron/manage_reminder.html
@@ -21,14 +21,7 @@
Manage Reminders
-
There are three types of reminder email supported by Janeway:
-
- - Review (Invited) - sent when a reviewer has been invited but not responded.
- - Review (Accepted) - sent when a reviewer has accepted a review request.
- - Revision - Sent for revision requests.
-
-
In addition you can also set reminders to be before or after the due date. It is recommended that you
- not create too many reminders for peer reviewers.
+ {% include "elements/cron/reminders_help.html" %}
Janeway has built in review reminder templates you can use.
diff --git a/src/templates/admin/cron/reminders.html b/src/templates/admin/cron/reminders.html
index 965e61f8f6..8b47ebd62d 100644
--- a/src/templates/admin/cron/reminders.html
+++ b/src/templates/admin/cron/reminders.html
@@ -20,14 +20,7 @@ Active Reminders
Add Reminders
-
Currently active Review and Revision reminders are listed below. You can edit, delete or create new reminders from this interface. There are three types of reminder email supported by Janeway:
-
- - Review (Invited) - sent when a reviewer has been invited but not responded.
- - Review (Accepted) - sent when a reviewer has accepted a review request.
- - Revision - Sent for revision requests.
-
-
In addition you can also set reminders to be before or after the due date. It is recommended that you not create too many reminders for peer reviewers.
-
+ {% include "elements/cron/reminders_help.html" %}