sgladstone/com.fountaintribe.hebrewcalendarhelper

Automation for reminders

Closed this issue · 10 comments

For email reminders to be sent directly to the email address of the mourner

The enhancement for email reminders is complete. The documentation is at: https://github.com/sgladstone/com.fountaintribe.hebrewcalendarhelper/wiki/Automated--reminders

For PDF/hard-copy reminders, the PDFs will be emailed to a staff member/volunteer

https://github.com/sgladstone/com.fountaintribe.hebrewcalendarhelper/wiki/Automated--reminders

There will be a CiviCRM scheduled job set to run daily. The daily scheduled job will have 3 required parameters: "group_names", "message_template_name", "email_address"

To have hard-copy reminders go out 15 days in advance: the job parameters would be:
group_names=mourners of a yahrzeit in 15 days
message_template=15 day yahrzeit message
staff_contact=CiviCRM contact id of "officemanager@example.org"

If there are 25 people observing a yahrzeit in exactly 15 days, then "officemanager@shul.org" will get an email with 1 PDF, containing the reminder letters for all 25 mourners. In a larger organization, "officemanager@shul.org" will likely get an email daily, each with one PDF attached. They could print and mail things immediately upon receiving the email, or they could wait a few days and print and mail a bunch. In a smaller organization, "officemanager@shul.org" would get an email with a PDF attachment infrequently, as many days there are no yahrzeits at all.

The assumption with the PDF, is that a staff member/volunteer would print the PDF and put the letters into envelopes.

The other thought I had is to add additional types of date ranges to the tokens. So in addition to tokens for exactly 7 days, there would also be tokens for "current week", "next week",

This sounds OK however, the yahrzeit letters shoud be able to viewed before hitting the send button due to their sensitivity and in case of any errors in the letters/emails.

With PDFs for hard-copy reminders, the staff/volunteer can easily review the PDF before sending to the printer. (Please re-read enhancement description, I just added more detail)

In the case of emails, the person is reviewing the message template, not the emails themselves. (Same as any other email sent from CiviCRM using a message template. )

Yes realised this after I sent the comment. So no worries this will be good functionality.

I am still struggling with the concept of the tokens getting resolved.

Need to be able to run say next month's yahrzeit search with a from and to date of 01-SEP-2016 to 30-SEP-2016 and let's say it produces 10 records with varying yahrzeit dates. The need is to create either an email/PDF which resolves the token values for each yahrzeit. Currently this does not seem to happen unless the specific ('exact') time period from today is specified like 'exact 7 days in the tokens'. The problem is the yahrzeit records returned have different yahrzeit dates over the month.

I think your email solution fixes this by running every day and calcs exactly 7 days in advance. So searches DB finds a record for 7 days time and resolves tokens and send the email. What happens if the job does not run?? How does the user produce an email/PDF letter as we are now within the 7 day period??

Looking forward to this enhancement.

@gzh1960, the tokens will still work if you change the number of days in the token.
For example {yahrzeit.relationship_name___day_7} is for a yahrtzeit in 7 days.
If you change the 7 to 5 {yahrzeit.relationship_name___day_5} it will print the record for a yahrtzeit in 5 days.

I have updated the wiki for this extension to describe how to set up email reminders. See the wiki page at: https://github.com/sgladstone/com.fountaintribe.hebrewcalendarhelper/wiki/Automated--reminders

If a scheduled job ( lets say for the 7 day yahrzeit reminders) failed, and you noticed it the next day you can do the following:

  1. Run the Yahrzeit Search from this extension with the filter for "Exactly 8 days".

  2. once you see the search results, choose the action at the top "Email - Send now (to 50 or less)". ( or "Email - schedule/send via CiviMail" and choose send immediately. )

  3. Use a template with yahrzeit tokens for "exactly 8 days"

FYI: If scheduled jobs are failing, I would also be concerned that the job that updates smart groups ( "Rebuild Smart Group Cache") had also failed. The smart group scheduled job is essential to automated email reminders working correctly.