Patch to add option to print Emailed reminders
Submitted by Ben_Charlton on Thu, 03/04/2014 - 19:09
I have been asked to create a option so that reminders that are emailed can also be printed in the same run for the same event.
I have attached the patch file
and a new ADL for the remindertypetemplate.
its a quick hack and I still need to work out a number of functions but can anyone see major flaws before I work on refinements. I didnt make this with the intent of asking for integration in the core.
Re: Patch to add option to print Emailed reminders
You also need to change ReminderGenerator to copy email ReminderEvents flagged for printing i.e. iterate through the list of reminders returned by:
List<List<ReminderEvent>> emailReminders = emailCollector.getReminders();
and add the matches to the list returned by:
List<List<ReminderEvent>> printReminders = printCollector.getReminders();
Re: Patch to add option to print Emailed reminders
I actually added them to the list during generation....in the ReminderProcessor.
The only thing I didnt do was update the event's action that is sent to the notifier to reflect the fact it was printed....however it still prints ok because its collected by the printercollecter process. During statistic generation however its recorded as being emailed twice....
As I said its a quick and dirty hack, I guess the better option would be to create an entirely new EVENT action called EmailsPrinted or something, that basically takes the duplicates and keeps them seperate.
It would mean a new collector and new listeners etc. but it would look better.
Re: Patch to add option to print Emailed reminders
Changed tactic here...decided that it was much easier to override the event when it was generated. In effect that means that if the alwaysPrint flag is set we just ensure the contact returned is a contact.location. ie override the REMINDER flag on contact.purpose.
This with the updated adl is all I think we needed in the end
Mind there are some javadoc changes in there that arent part of my changes.