Putting Item Information Into Notices 6

The text of notices in Koha can be customized through Tools > Notices. There are some fields in the notices in brackets <<like this>> that Koha can fill in automatically for you. The information in these fields can be specific to the patron, the library, or to the items that correspond with the notice. I want to address specifically the fields with information about the item.

On overdue notices, it is possible to use <item></item> tags to list out the fields that you want to have automatically filled in.

In Tools > Notices, you click on Edit beside the Overdue Notice, and in the message body you write:

Dear <<borrowers.firstname>> <<borrowers.surname>>,

According to our records, the following items are overdue. Please return them as soon as possible.

<item> “<<biblio.title>>‚Äù by <<biblio.author>>, Due Date: <<issues.date_due>> </item>

Thank you,

Library Staff

The notice will look like this:

Dear John Doe,

According to our records, the following items are overdue. Please return them as soon as possible:

“The Wellspring‚Äù by Sharon Olds, Due Date: 04/12/2012

Thank you,

Library Staff

However, you can only use the <item></item> tags on overdue notices. I repeat, you can only use the <item></item> tags on overdue notices! If you want information about the item to appear, for example, on your Advance Notice of Item Due, then you need to use <<items.content>>.

This is a two step process. First, from Tools > Notices, you click on Edit, and in the message body you write:

Dear <<borrowers.firstname>> <<borrowers.surname>>,

The following item will be due soon:


Next, you will need to make sure that the cron job knows what information to automatically fill in for the <<items.content>> tag. You will tell Koha what information to put in by editing the advancenotices.pl cron job. (You may need to ask your support provider for help with this step.) You will add:

-itemscontent date_due,title,author

On a Git installation, the cron job should look something like this:

30 8 * * * $KOHA_CRON_PATH/advance_notices.pl-c -itemscontent date_due,title,author

On a package installation, the cron job should look something like this:

koha-foreach –enabled –email /usr/share/koha/bin/cronjobs/advance_notices.pl-c –itemscontent date_due,title,author

Once those two steps are complete, the notice will look like this:

Dear John Doe,

The following item will be due soon:

04/22/2012 “The Wellspring‚Äù Sharon Olds

The only tricky thing to remember here is that you can use <<items.content>> for any kind of notice, but you can only use <item></item> tags on overdue notices.

Leave a comment

Your email address will not be published. Required fields are marked *

Are you human? * Time limit is exhausted. Please reload CAPTCHA.

6 thoughts on “Putting Item Information Into Notices

  • Steve Campbell

    Melia, thanks for providing this very helpful explanation.

    One additional feature to mention (at least in 3.8.1) is that in a digest message the <> will be repeated for each item that applies. So in your example you might see:

    The following items will be due soon:

    09/12/2012 The Hobbit J R R Tolkien
    09/12/2012 Hamlet William Shakespeare

    I have used this notation at our library, and I found two minor ways where it differs from what your examples show. One is that our due date shows date and time: 09/12/2012 23:59. Your example shows only the date, which I think is better. Can we get rid of the timestamp somehow?

    The second thing is that for us the title is not in quotes. How did you get those quotes?

    Oh, our cron job argument is

    -itemscontent date_due,title,barcode,author,itemcallnumber

    Thanks again.

    Steve Campbell
    Converse Free Library, Lyme, New Hampshire

    • Melia

      Hi Steve,

      Thanks for your comments!

      Regarding date vs. date and timestamp – you are absolutely correct that this is different in 3.8. When I wrote this blog post, 3.8 wasn’t out yet. When 3.8 was released, it included hourly loans as a new feature. Hourly loans necessitated that the database contain a datetime in many places that used to only contain a date. This meant that date_due went from being just a date to now being a date and time, to accommodate those items that are due in just a short number of hours rather than in full days. Now that the database field contains a datetime, I don’t know of any way to get just the date to show up on your notice. It may be possible with some fancy jquery, but that is not my field of expertise! If you could enter a support ticket, we could have someone else on the ByWater team make an attempt at it. This might also be a good question for one of the Koha mailing lists as well.

      About having the quotes around the title – in the first example that uses the <item></item> tags, you can get the quotes around the title simply by writing them on the outside of the brackets, like this: “<<biblio.title>>” . In the second example that uses the items.content cron job, you are correct that it will not print in the notice with quotes around the title. That was a copy/paste error on my part, and thanks for correcting it. I don’t know of any way to get the quotes around the title using the cron job. You could try using the <item></item> tags instead of the <<items.content>> to get quotes around the title on your overdue notices.



  • Watson Mick

    Dear Melia,
    For the tags, how can I have the display go line by line instead of stringing together into a ‘paragraph’? I’ve tried but it doesn’t work.

    “Principles Of Auditing ” by Hayes, Rick, HF5667.H365 2005, Barcode: A 07982-2 Fines: GBP “Modern Auditing & Assurance Services ” by Leung, Philomena, HF5667.M63 2009, Barcode: A 06093-3 Fines: GBP

    Also, why doesn’t the fines amount show in the notice?
    I’m using Fines: GBP

    • Melia Meggs Post author

      Hi Watson,

      I see what you mean in your example. Could you copy/paste the exact notice syntax that you’re using in here? My notice shows one item per line like you want, so I wonder if we have some subtle differences in how we have each written the notice.

      The fine amount isn’t showing currently because of this bug: http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8378. When the community has resolved that bug, hopefully you’ll be able to see the fine amount in your notice again!



  • Watson Mick

    Dear Melia,
    Thanks for your help. Can I communicate directly to your email because in my previous response, all the html tags that I cut and paste is not displayed.

    • Nicole C. Engard


      Melia is on vacation right now, but for getting more detailed help may I recommend that you email your questions/problems to the Koha mailing list. There are lots of people there who can lend a hand. Or if you have a support provider you might want to use the ticketing system they offer to get some official help.