rero / rero-ils

Integrated Library System flavour of Invenio by RERO+.
http://ils.test.rero.ch
GNU Affero General Public License v3.0
72 stars 27 forks source link

Overdue notifications: inconsistency between reminder numbers #2390

Closed pronguen closed 3 years ago

pronguen commented 3 years ago

Describe the bug

For a 2nd reminder, the reminder number is not the same in the e-mail object and in the note (e-mail body).

To Reproduce

Not clear. Maybe the problem happens with all 2nd reminders. See example.

Expected behavior

The reminder number is the same in the two places.

Context

Example

Sujet : 1er rappel
--
De : "noreply@rero.ch" <noreply@rero.ch>
Date : 16.09.2021, 07:34

Patron pid: 64434
Street number
2800 DELEMONT

Chère lectrice, cher lecteur,

La durée du prêt des documents mentionnés ci-dessous est échue :

Titre : Les runes : [la magie de leurs pouvoirs] / Jean-Paul Ronecker
Echéance : 24.08.2021
Note : deuxième rappel

Vous pouvez consulter votre compte et prolonger la durée de prêt de vos documents à l'adresse : [...]

Avec nos compliments

Bibliothèque municipale de Delémont - section adultes
Rue de l'Hôpital 47, 2800 Delémont
zannkukai commented 3 years ago

@pronguen This is "normal" at this time because the subject is hardcoded into the template (https://github.com/rero/rero-ils/blob/dev/rero_ils/modules/notifications/templates/email/overdue/fre.txt#L1).

In the notification refactoring PR, I simply use "Rappel" subject (removing the numbering).

As OVERDUE messages could be aggregated, we could send 1 reminder for itemA, second reminder for itemB and fourth reminder for itemC in the same message. So it's impossible to determine the subject based on the reminder counter. This is why I choose "Rappel" simple string as subject.

An other solution could be to aggregated reminders notification adding the reminder_counter into the aggregation key. In this case : if we need to process 3 notifs (1st_reminder for itemA, 1st_reminder for itemB, 4th_reminder for itemC), the dispatcher will send 2 mail --> 1 for both 1st_reminder, 1 for the 4th_reminder (the user could receive several emails for overdue notifications in the same day)

pronguen commented 3 years ago

@zannkukai Happy to know that it is as expected!

Indeed, I knew the problem of the overdue grouping. Maybe the aggregation only within the same overdue number is better, if the library has e-mail filters based on the e-mail object.

But for now, I am ok with both solutions. So let's follow the easiest way.

zannkukai commented 3 years ago

@pronguen The reminders workflow allows to choose which template to use for which reminders. So it's possible (and even better ?) to create a new template files in the system for each overdue reminder. At UCLouvain, we will create separate template files for last reminders --> sent by mail with special juridic content. The subject of this mail should be "last reminder before jail !"