Scheduled repeat of email notifications to genebanks
The MaterialSubRequest
maintains the state
(0 for receipt not confirmed and 1 for confirmed) and the lastReminderDate
.
Implement a scheduled task (to run every 4 hours) that:
- Finds sub requests with
state == 0
andlastReminderDate > 5 days ago
. - Exclude requests with
lastReminderDate > 1 month
. - Call
relayRequest(MaterialSubRequest materialSubRequest)
inRequestServiceImpl
to send out new email. This updateslastReminderDate
.