Patron emailer
Alex Buckley
Agenda
- Patron emailer basics
- Community patron emailer
- Patron emailer plugin
-
How do you know which patrons were emailed?
- Q & A
Patron emailer basics
- Send custom email notices to specific library patrons at a frequency of your choice.
- You define which patrons will receive the custom email notice in a SQL report or CSV file.
- Requires configuration of a SQL report, email notice and some Koha support vendor setup.
Patron emailer basics
Two options:
-
Regular custom notices
- Then setup the community patron emailer cronjob
-
One-off custom notices
- Then set-up the patron emailer plugin
Community patron emailer cronjob
Added to Koha 19.05 in bug 16149
Setup steps
- Create SQL report - returns the specific patrons who will receive the notice
- Create notice - the notice that will be sent
- Request your Koha support vendor schedule the cronjob - this will actually schedule the notice to be sent
Step 1) Create SQL report
1) Staff client > Reports > Create from SQL
2) Query the borrowers table
3) Introduce a WHERE clause - This filters which patron accounts will be returned by the report and therefore be emailed.
Note: Without adding a WHERE clause all library patrons will be emailed.
Example SQL report
Step 2) Create email notice
1) Staff client > Tools > Members and circulation > Notices and slips > New notice
2) Choose the notice module
3) Choose a notice code and name
4) Add content in the 'Email' section using template toolkit syntax
Important note
- The data fields you reference in the notice text MUST match those defined in the SQL report
Template toolkit
- Surround database fields with [% %] instead of << >>:
e.g. [% firstname %] instead of <<firstname>>
- You can display data based on a condition being met:
[% IF categorycode == "PG" %]
....
[% ELSIF categorycode == "UG" %]
...
[% END %]
Example email content
Step 3) Schedule the patron emailer cronjob
Request your Koha support vendor schedule the patron emailer cronjob - to actually send the email notices.
Provide the following information:
- Koha SQL report ID
- Koha notice code
- Koha notice module name
- Time and frequency when you would want the patron emailer notices to be sent
- What 'from' email address would you like set
Patron emailer plugin
Setup steps
- Ask your Koha support vendor to enable Koha plugins
- Install the Koha patron emailer plugin
- Create SQL report - returns the specific patrons who will receive the notice
- Create notice - the notice that will be sent
- Manually trigger the plugin - sends the email notices
Step 1) Ask your Koha support vendor to enable Koha plugins
Step 2) Install the Koha patron emailer plugin
- Administration > Plugins > Manage plugins > Upload plugin
- Upload the plugin KPZ file: download from here
Step 3) Create SQL report
- As with the community patron emailer, include the same fields in your SQL report as the email notice.
- You can include runtime parameters - a filter you're prompted to fill out when running the SQL report.
Example SQL report
Step 4) Create notice
Step 5) Manually trigger the plugin
Administration > Plugins > Manage plugins > '[KK-fork] Patron Emailer' > Actions > Run tool
Step 5) Manually trigger the plugin
How do you know which patrons were emailed?
SQL report
SELECT cardnumber, firstname, surname, content, time_queued, status
FROM borrowers
LEFT JOIN message_queue USING (borrowernumber)
WHERE letter_code = <<Enter letter code>>
Questions?
Koha patron emailer
By alexbuckley
Koha patron emailer
- 119