[OPEN-ILS-DEV] overdue and pre-due notice config

2008-08-06 Thread Bill Erickson


I'm beginning work on courtesy (predue) notices and a re-architecture of  
the existing overdue notice script for better templating and  
configuration.  Attached is a sample configuration section (from  
opensrf.xml) I created for setting these up.  I wanted to work backwards  
from the configuration to the code to make sure the requirements are  
accurately represented.  This configuration is only for email notices and  
generating a local XML file (for sending to a vendor, creating local mail  
notices, etc.).  This is not the full-blown notication system (telephony,  
etc.) described in  
http://open-ils.org/dokuwiki/doku.php?id=scratchpad:notification_systems=notices.   
However, I'd like to think that this is at least a step in that direction.


For predue notices, there was a discussion of basing the notice date on a  
percentage of the total circulation duration.  I toyed with that some and  
decided in the end to model predue notices on duration date ranges  
instead.  It's just easier on the eyes.  I'm open to discussion on that  
one, though.


For 1.4.0, the plan is to have locale-aware templates, built with Perl's  
Template Toolkit.  1.4.X will introduce per-org-unit templates.


Suggestions and comments on the configuration welcome.

-b



--
Bill Erickson
| VP, Software Development  Integration
| Equinox Software, Inc. / The Evergreen Experts
| phone: 877-OPEN-ILS (673-6457)
| email: [EMAIL PROTECTED]
| web: http://esilibrary.com  notifications

!-- global mail server settings --
smtp_serverlocalhost/smtp_server
sender_address[EMAIL PROTECTED]/sender_address

!-- Overdue notices --
overdue

!-- optionally, you can define a sender address per notice type --
sender_address[EMAIL PROTECTED]/sender_address

!-- The system can generate an XML file of overdue notices.  This is the 
directory where they are stored.  Files are named overdue.-MM-DD.xml --
notice_dir/openils/var/data/overdue/notice_dir

notice

!-- Notify at 7 days overdue --
notify_interval7 days/notify_interval

!-- Options include always, noemail, and never.  'noemail' means a notice
 will be appended to the notice file only if the patron has no valid email address.  --
file_appendnoemail/file_append

!-- do we attempt email notification? --
email_notifytrue/email_notify

!-- notice template file --
template/openils/var/data/templates/overdue_7day/template
/notice

notice
notify_interval14 days/notify_interval
file_appendalways/file_append
email_notifytrue/email_notify
template/openils/var/data/templates/overdue_14day/template
/notice
/overdue

!-- Courtesy notices --
predue
notice_dir/openils/var/data/predue/notice_dir
notice

!-- All circulations that circulate between 5 and 13 days --
circ_duration_range5 days,13 days/circ_duration_range

!-- notify at 1 day before the due date --
notify_interval1 day/notify_interval

file_appendfalse/file_append
email_notifytrue/email_notify
template/openils/var/data/templates/predue_1day/template
/notice

notice

!-- All circulations that circulate for 14 or more days --
circ_duration_range14 days/circ_duration_range
notify_interval2 day/notify_interval

file_appendfalse/file_append
email_notifytrue/email_notify
template/openils/var/data/templates/predue_2day/template
/notice
/predue

held_item_ready
notice
email_notifytrue/email_notify
template/openils/var/data/templates/held_item_ready/template
/notice
/held_item_ready
  /notifications



Re: [OPEN-ILS-DEV] overdue and pre-due notice config

2008-08-06 Thread Dan Scott
Hi Bill:

2008/8/6 Bill Erickson [EMAIL PROTECTED]:

 I'm beginning work on courtesy (predue) notices and a re-architecture of the
 existing overdue notice script for better templating and configuration.

Excellent!

  Attached is a sample configuration section (from opensrf.xml) I created for
 setting these up.  I wanted to work backwards from the configuration to the
 code to make sure the requirements are accurately represented.  This
 configuration is only for email notices and generating a local XML file (for
 sending to a vendor, creating local mail notices, etc.).  This is not the
 full-blown notication system (telephony, etc.) described in
 http://open-ils.org/dokuwiki/doku.php?id=scratchpad:notification_systems=notices.
  However, I'd like to think that this is at least a step in that direction.

 For predue notices, there was a discussion of basing the notice date on a
 percentage of the total circulation duration.  I toyed with that some and
 decided in the end to model predue notices on duration date ranges instead.
  It's just easier on the eyes.  I'm open to discussion on that one, though.

I think you've made the right choice, although I have some suggestions
for the duration range configuration syntax (below).

 For 1.4.0, the plan is to have locale-aware templates, built with Perl's
 Template Toolkit.  1.4.X will introduce per-org-unit templates.

Excellent!

 Suggestions and comments on the configuration welcome.

Some general comments:
It's not explicit, but I suspect this could be used/abused for items
like laptops that might have a four hour circulation period, so that
you could send an email 30 mins in advance to remind the user that
it's due real soon now.

For the pre-overdues, it would be nice to take advantage of the
system's knowledge of the circ rule in play to offer a link to a
renewal page (if applicable for each item) and specify the fines that
will be accrued.

I'm also hoping that this will group items together in some way,
rather than generating one email per item.

Specific comment on the configuration syntax:
At first glance, I didn't find the circ_duration_range syntax
particularly intuitive. 5 days, 13 days looked like an OR set of
items, and 14 days on its own looked like, well, just 14 days, not
14 days or more. At the risk of making the XML even more verbose, but
perhaps more intuitive, I would propose something more like the
following:

!-- rather than 5 days, 13 days notation --
circ_duration_range
  from5 days/from
  to13 days/to
/circ_duration_range

!-- for items with a circ duration of exactly 28 days, set from == to --
circ_duration_range
  from28 days/from
  to28 days/to
/circ_duration_range

!-- if to element is missing, then the range extends to the end of time --
circ_duration_range
  from14 days/from
/circ_duration_range

!-- if from element is missing, then the range extends from the
start (0 mins) to to --
circ_duration_range
  to5 days/to
/circ_duration_range

!-- and if circ_duration_range holds neither from nor to, then it
encompasses all circ_duration ranges --
circ_duration_range/circ_duration_range

-- 
Dan Scott
Laurentian University


Re: [OPEN-ILS-DEV] overdue and pre-due notice config

2008-08-06 Thread Bill Erickson

On Wed, 06 Aug 2008 13:00:48 -0400, Dan Scott [EMAIL PROTECTED] wrote:


Hi Bill:

2008/8/6 Bill Erickson [EMAIL PROTECTED]:




[snip]



Some general comments:
It's not explicit, but I suspect this could be used/abused for items
like laptops that might have a four hour circulation period, so that
you could send an email 30 mins in advance to remind the user that
it's due real soon now.


That should be feasible.  I'm thinking we need a command-line param to the  
notifier which tells it to generate notices for circs that have a  
notify_interval of = 1 day.  That way, CRON can be set up to run the  
notifier every hour, but once a day it will set the switch to generate  
notices for = 1 day notify_interval items.  In other words, if I'm  
supposed to get a notice today about an item due tomorrow, I won't get a  
notice every hour.





For the pre-overdues, it would be nice to take advantage of the
system's knowledge of the circ rule in play to offer a link to a
renewal page (if applicable for each item) and specify the fines that
will be accrued.


I like that.



I'm also hoping that this will group items together in some way,
rather than generating one email per item.


The current behavior for overdues and planned behavior for this next batch  
of code is to generate one email per type of notice.  E.g. 1 email for all  
items 7 days overdue, 1 email for all items 14 days overdue, etc.  This  
allows for separate templates for each type.  Is this grouped enough or do  
you think putting all notices into a single email is crucial?





Specific comment on the configuration syntax:
At first glance, I didn't find the circ_duration_range syntax
particularly intuitive. 5 days, 13 days looked like an OR set of
items, and 14 days on its own looked like, well, just 14 days, not
14 days or more. At the risk of making the XML even more verbose, but
perhaps more intuitive, I would propose something more like the
following:

!-- rather than 5 days, 13 days notation --
circ_duration_range
  from5 days/from
  to13 days/to
/circ_duration_range

!-- for items with a circ duration of exactly 28 days, set from ==  
to --

circ_duration_range
  from28 days/from
  to28 days/to
/circ_duration_range

!-- if to element is missing, then the range extends to the end of  
time --

circ_duration_range
  from14 days/from
/circ_duration_range

!-- if from element is missing, then the range extends from the
start (0 mins) to to --
circ_duration_range
  to5 days/to
/circ_duration_range

!-- and if circ_duration_range holds neither from nor to, then it
encompasses all circ_duration ranges --
circ_duration_range/circ_duration_range




That works for me.

Thanks, Dan!

-b

--
Bill Erickson
| VP, Software Development  Integration
| Equinox Software, Inc. / The Evergreen Experts
| phone: 877-OPEN-ILS (673-6457)
| email: [EMAIL PROTECTED]
| web: http://esilibrary.com