Hello,
I am using a mail merge created by an earlier co-worker, with the purpose of sending out late/overdue notices to library patrons, using an excel file created by our catalog program as a source for recipients. The issue I need to fix is to edit the mail merge in a way that will combine any library items that apply to one email address, to all be sent in a single message. The current system sends multiple emails to the same person for each item they have overdue/lost. Here is a copy of the mail merge below, please suggest any edits that may be able to accomplish this (or any scripts/addons that would help).
Thanks,
Paul
---------------------------------
Dear { MERGEFIELD first } { MERGEFIELD last },{ IF{ = ({ IF{ MERGEFIELD categorycode } = "STAFF" 1 0 } +
{ IF{ MERGEFIELD categorycode } = "FACULTYP" 1 0 } + { IF{ MERGEFIELD categorycode } = "FACULTYF" 1
0 }) } >= 1 "{ IF { MERGEFIELD Notice_type } = General_Reminder_notice "{ IF { MERGEFIELD type } =
oneWeek "
This is a reminder that the following item is due soon and should be returned to the location below as
soon as possible to avoid overdue fines:" "
This is a reminder that the following item is due on the final day of the semester. Please return it
promptly so that we can ensure our collection is open to other members of the campus community." } "
}" "{ IF { MERGEFIELD Notice_type } = General_Reminder_notice "
This is a reminder that the following item is due soon and should be returned to the location below as
soon as possible to avoid overdue fines:" "" }"}{ IF { =({ IF{ MERGEFIELD categorycode } = "STAFF" 1 0 } +
{ IF{ MERGEFIELD categorycode } = "FACULTYF" 1 0} + { IF{ MERGEFIELD categorycode } = "FACULTYP" 1
0 }) } >= 1 "{ IF { MERGEFIELD Notice_type } = General_First_notice "
This is a reminder that the following item is now overdue and should be returned to the location below
as soon as possible to make it available to other members of the campus community." "" }" "{ IF {
MERGEFIELD Notice_type } = General_First_notice "
This is a reminder that the following item is overdue and should be returned to the location below as
soon as possible to prevent the further accumulation of overdue fines:" "" }" }{ IF { =({ IF{ MERGEFIELD
categorycode } = "STAFF" 1 0 } + { IF{ MERGEFIELD categorycode } = "FACULTYF" 1 0} + { IF{ MERGEFIELD
categorycode } = "FACULTYP" 1 0 }) } >= 1 "{ IF { MERGEFIELD Notice_type } = General_Second_notice "{
IF{ MERGEFIELD location } = DVD "
This is a reminder that the library DVD listed below is overdue. We ask that you return the item so that
others, including students, can have access to that information.
We are happy to provide extended checkout periods for faculty and staff, but ask that you honor the
shorter due dates for DVDs because they are more frequently used and requested. Please understand
that the week‐long loan period for DVDs is to ensure that all library materials are accessible to the entire
campus community. If you feel that you need the item for a longer period for instructional purposes,
please contact library staff to make an arrangement. Thank you for using the library." "
This is a reminder that the library item listed below was due at the end of last semester. We ask that
you return the item so that others, including students, can have access to that information.
We are happy to provide the semester‐long checkout periods for faculty and staff, but ask that you
honor these due dates to ensure that all library materials are accessible to the entire campus
community. If you feel that you need the item for a longer period for instructional purposes, please
contact library staff to make an arrangement. Thank you for using the library." }
" "" }" "{ IF { MERGEFIELD Notice_type } = "General_Second_notice" "
This is a reminder that the following item is overdue and should be returned to the location below as
soon as possible to prevent the further accumulation of overdue fines:" "" }" }
{ IF{
MERGEFIELD
Notice_type } =
General_Remin
der_notice "Due
{ MERGEFIELD
date_due }" ""
}{ IF {
MERGEFIELD
Notice_type } =
General_First_n
otice "Notice 1"
"" }{ IF {
MERGEFIELD
Notice_type } =
General_Second
_notice "Notice
2" "" }{ IF {
MERGEFIELD
Notice_type } =
Paperback_Lost
_notice "Lost
Item Notice" ""
}{ IF {
MERGEFIELD
Notice_type } =
General_Lost_n
otice "Lost Item
Notice"}
Title: { MERGEFIELD title } { IF{ MERGEFIELD title } = "Paperbacks" " ‐ '{ MERGEFIELD enum
}'" "" }{ IF{ MERGEFIELD location } = "PERIODICAL" "‐{ MERGEFIELD enum } "" "" }
{ IF {
MERGEFIELD
title } <>
"Paperbacks"
"Call Number: ""
"" }
{ MERGEFIELD
branch }
{ MERGEFIELD
location }
{ IF { MERGEFIELD title } <> "Paperbacks" { MERGEFIELD
call_number } "" }
{ IF {
MERGEFIELD
location } <>
"BROWSING"
"Author:" "" }
{ MERGEFIELD
author }
{ MERGEFIELD
barcode }
{ IF { MERGEFIELD Notice_type } = Paperback_Lost_notice "
As of { MERGEFIELD Lost_date } this paperback is overdue by 90 days, which means that the library
assumes it is lost.
Items in our paperbacks collection do not accrue overdue fines and have no replacement fees.
However, if you are unable to return the item we would appreciate it if you would consider donating a
comparable paperback book in its place so that we can continue to make this collection available to
our library patrons.
" "" }{ IF { =({ IF{ MERGEFIELD categorycode } = "STAFF" 1 0 } + { IF{ MERGEFIELD categorycode } =
"FACULTYF" 1 0} + { IF{ MERGEFIELD categorycode } = "FACULTYP" 1 0 }) } >= 1 "{ IF { MERGEFIELD
Notice_type } = "General_Lost_notice" "
As of { MERGEFIELD Lost_date } the above item is long overdue and is now considered lost. Please note
that as a CR employee, you are not held liable for replacement fees, but keep in mind that we strive to
make all of our resources available to everyone. If you are unable return the item you checked out,
please consider donating a replacement copy so that we can continue to make it available to others in
the future.
" "" } " "{ IF { MERGEFIELD Notice_type} = "General_Lost_notice" "
As of { MERGEFIELD Lost_date } the above item is long overdue and is now considered lost. You are now
responsible for the replacement cost of the item as well as the overdue processing fee. If you return the
item, you will not need to pay the replacement fee. If you have lost the item you may contact the library
about providing your own replacement instead of paying the replacement fee.
Fines and Fees Summary
Replacement Price: ${ MERGEFIELD
replacementprice }
Overdue Fine: $10.00
" "" }" }
{ IF{ MERGEFIELD Notice_type }= General_Reminder_notice "If you are liable for overdue fines, please
keep in mind that the fine increases the longer you keep the item. You may also be charged for the
replacement cost if the item is not returned.
" "" }{ IF{ MERGEFIELD Notice_type }= General_First_notice "If you are liable for overdue fines, please
keep in mind that the fine increases the longer you keep the item. You may also be charged for the
replacement cost if the item is not returned.
" "" }{ IF{ MERGEFIELD Notice_type }= General_Second_notice "If you are liable for overdue fines, please
keep in mind that the fine increases the longer you keep the item. You may also be charged for the
replacement cost if the item is not returned.
" "" }If you have any questions, please contact us at the location below or reply to this email.
{ IF { MERGEFIELD Notice_type } = General_Reminder_notice "
To renew items, view fines and check your account status if you believe this notice was sent in error,
please visit http://library.blank.edu/cgi‐bin/koha/opac‐user.pl to log in to your online library
account (your username is the same as your myblank/Webadvisor ID and your password is your six‐digit
birthdate)." "" }{ IF { MERGEFIELD Notice_type } = General_First_notice "
To renew items, view fines and check your account status if you believe this notice was sent in error,
please visit http://library.blank.edu/cgi‐bin/koha/opac‐user.pl to log in to your online library
account (your username is the same as your myblank/Webadvisor ID and your password is your six‐digit
birthdate)." "" }{ IF { MERGEFIELD Notice_type } = General_Second_notice "
To renew items, view fines and check your account status if you believe this notice was sent in error,
please visit http://library.blank.edu/cgi‐bin/koha/opac‐user.pl to log in to your online library
account (your username is the same as your myblank/Webadvisor ID and your password is your six‐digit
birthdate)." "" }
College of the blank Library
{ MERGEFIELD branchaddress1 }
{ MERGEFIELD branchcity }, { MERGEFIELD branchstate } { MERGEFIELD branchzip }
Phone: { MERGEFIELD branchphone }
Fax: { MERGEFIELD branchfax }