(message_transport_type)
values
('email'),
-('sms')
-('feed');
+('sms');
('circulation','PREDUEDGST','Advance Notice of Item Due (Digest)','Advance Notice of Item Due','You have <<count>> items due soon'),
('circulation','EVENT','Upcoming Library Event','Upcoming Library Event','Dear <<borrowers.firstname>> <<borrowers.surname>>,\r\n\r\nThis is a reminder of an upcoming library event in which you have expressed interest.'),
('reserves', 'HOLD', 'Hold Available for Pickup', 'Hold Available for Pickup at <<branches.branchname>>', 'Dear <<borrowers.firstname>> <<borrowers.surname>>,\r\n\r\nYou have a hold available for pickup as of <<reserves.waitingdate>>:\r\n\r\nTitle: <<biblio.title>>\r\nAuthor: <<biblio.author>>\r\nCopy: <<items.copynumber>>\r\nLocation: <<branches.branchname>>\r\n<<branches.branchaddress1>>\r\n<<branches.branchaddress2>>\r\n<<branches.branchaddress3>>'),
-('circulation','CHECKINDGST','Item Check-in (Digest)','Check-ins','The following items have been checked in:\r\n<<items.content>>'),
-('circulation','CHECKOUTDGST','Item Check-out (Digest)','Checkouts','The following items have been checked out:\r\n<<items.content>>');
+('circulation','CHECKIN','Item Check-in (Digest)','Check-ins','The following items have been checked in:\r\n----\r\n<<biblio.title>>\r\n----\r\nThank you.'),
+('circulation','CHECKOUT','Item Check-out (Digest)','Checkouts','The following items have been checked out:\r\n----\r\n<<biblio.title>>\r\n----\r\nThank you for visiting <<branches.branchname>>.');
(2, 'sms', 1, 'circulation', 'PREDUEDGST'),
(3, 'sms', 0, 'circulation', 'EVENT'),
(4, 'sms', 0, 'reserves', 'HOLD'),
-(5, 'email', 1, 'circulation', 'CHECKINDGST'),
-(5, 'sms', 1, 'circulation', 'CHECKINDGST'),
-(5, 'feed', 1, 'circulation', 'CHECKINDGST'),
-(6, 'email', 1, 'circulation', 'CHECKOUTDGST'),
-(6, 'sms', 1, 'circulation', 'CHECKOUTDGST'),
-(6, 'feed', 1, 'circulation', 'CHECKOUTDGST');
+(5, 'email', 0, 'circulation', 'CHECKIN'),
+(5, 'sms', 0, 'circulation', 'CHECKIN'),
+(6, 'email', 0, 'circulation', 'CHECKOUT'),
+(6, 'sms', 0, 'circulation', 'CHECKOUT'),
(message_transport_type)
values
('email'),
-('sms')
+('sms'),
('feed');
('circulation','PREDUEDGST','Advance Notice of Item Due (Digest)','Advance Notice of Item Due','You have <<count>> items due soon'),
('circulation','EVENT','Upcoming Library Event','Upcoming Library Event','Dear <<borrowers.firstname>> <<borrowers.surname>>,\r\n\r\nThis is a reminder of an upcoming library event in which you have expressed interest.'),
('reserves', 'HOLD', 'Hold Available for Pickup', 'Hold Available for Pickup at <<branches.branchname>>', 'Dear <<borrowers.firstname>> <<borrowers.surname>>,\r\n\r\nYou have a hold available for pickup as of <<reserves.waitingdate>>:\r\n\r\nTitle: <<biblio.title>>\r\nAuthor: <<biblio.author>>\r\nCopy: <<items.copynumber>>\r\nLocation: <<branches.branchname>>\r\n<<branches.branchaddress1>>\r\n<<branches.branchaddress2>>\r\n<<branches.branchaddress3>>'),
-('circulation','CHECKINDGST','Item Check-in (Digest)','Check-ins','The following items have been checked in:\r\n<<items.content>>'),
-('circulation','CHECKOUTDGST','Item Check-out (Digest)','Checkouts','The following items have been checked out:\r\n<<items.content>>');
+('circulation','CHECKIN','Item Check-in (Digest)','Check-ins','The following items have been checked in:\r\n----\r\n<<biblio.title>>\r\n----\r\nThank you.'),
+('circulation','CHECKOUT','Item Check-out (Digest)','Checkouts','The following items have been checked out:\r\n----\r\n<<biblio.title>>\r\n----\r\nThank you for visiting <<branches.branchname>>.');
(2, 'sms', 1, 'circulation', 'PREDUEDGST'),
(3, 'sms', 0, 'circulation', 'EVENT'),
(4, 'sms', 0, 'reserves', 'HOLD'),
-(5, 'email', 1, 'circulation', 'CHECKINDGST'),
-(5, 'sms', 1, 'circulation', 'CHECKINDGST'),
-(5, 'feed', 1, 'circulation', 'CHECKINDGST'),
-(6, 'email', 1, 'circulation', 'CHECKOUTDGST'),
-(6, 'sms', 1, 'circulation', 'CHECKOUTDGST'),
-(6, 'feed', 1, 'circulation', 'CHECKOUTDGST');
+(5, 'email', 0, 'circulation', 'CHECKIN'),
+(5, 'sms', 0, 'circulation', 'CHECKIN'),
+(6, 'email', 0, 'circulation', 'CHECKOUT'),
+(6, 'sms', 0, 'circulation', 'CHECKOUT'),
`borrowernumber` int(11) default NULL,
`subject` text,
`content` text,
+ `metadata` text DEFAULT NULL,
+ `letter_code` varchar(64) DEFAULT NULL,
`message_transport_type` varchar(20) NOT NULL,
`status` enum('sent','pending','failed','deleted') NOT NULL default 'pending',
`time_queued` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
`branchcode` varchar(10) NOT NULL,
`categorycode` varchar(10) NOT NULL,
`item_type` varchar(10) NOT NULL,
- `is_enabled` tinyint(1) NOT NULL default '0',
+ `notification` varchar(16) NOT NULL,
PRIMARY KEY (`id`),
- KEY `branchcode` (`branchcode`,`categorycode`,`item_type`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8
+ KEY `branchcode` (`branchcode`,`categorycode`,`item_type`, `notification`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
branchcode varchar(10) NOT NULL,
categorycode varchar(10) NOT NULL,
item_type varchar(10) NOT NULL,
- is_enabled tinyint(1) NOT NULL DEFAULT 0,
+ notification varchar(16) NOT NULL,
PRIMARY KEY (id),
- KEY (branchcode, categorycode, item_type)
+ KEY (branchcode, categorycode, item_type, notification)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
");
+
+ $dbh->do(q{ ALTER TABLE `message_queue` ADD metadata text DEFAULT NULL AFTER content; });
+ $dbh->do(q{ ALTER TABLE `message_queue` ADD letter_code varchar(64) DEFAULT NULL AFTER metadata; });
+
$dbh->do(q{
INSERT INTO `letter` (`module`, `code`, `name`, `title`, `content`) VALUES
- ('circulation','CHECKINDGST','Item Check-in (Digest)','Check-ins','The following items have been checked in:\r\n<<items.content>>');
+ ('circulation','CHECKIN','Item Check-in','Check-ins','The following items have been checked in:\r\n----\r\n<<biblio.title>>\r\n----\r\nThank you.');
});
$dbh->do(q{
INSERT INTO `letter` (`module`, `code`, `name`, `title`, `content`) VALUES
- ('circulation','CHECKOUTDGST','Item Check-out (Digest)','Checkouts','The following items have been checked out:\r\n<<items.content>>');
+ ('circulation','CHECKOUT','Item Checkout','Checkouts','The following items have been checked out:\r\n----\r\n<<biblio.title>>\r\n----\r\nThank you for visiting <<branches.branchname>>.');
});
$dbh->do(q{INSERT INTO message_attributes (message_attribute_id, message_name, takes_days) VALUES (5, 'Item Check-in', 0);});
$dbh->do(q{INSERT INTO message_attributes (message_attribute_id, message_name, takes_days) VALUES (6, 'Item Checkout', 0);});
- $dbh->do(q{INSERT INTO message_transport_types (message_transport_type) VALUES ('feed');});
-
- $dbh->do(q{INSERT INTO message_transports (message_attribute_id, message_transport_type, is_digest, letter_module, letter_code) VALUES (5, 'email', 1, 'circulation', 'CHECKINDGST');});
- $dbh->do(q{INSERT INTO message_transports (message_attribute_id, message_transport_type, is_digest, letter_module, letter_code) VALUES (5, 'sms', 1, 'circulation', 'CHECKINDGST');});
- $dbh->do(q{INSERT INTO message_transports (message_attribute_id, message_transport_type, is_digest, letter_module, letter_code) VALUES (5, 'feed', 1, 'circulation', 'CHECKINDGST');});
- $dbh->do(q{INSERT INTO message_transports (message_attribute_id, message_transport_type, is_digest, letter_module, letter_code) VALUES (6, 'email', 1, 'circulation', 'CHECKOUTDGST');});
- $dbh->do(q{INSERT INTO message_transports (message_attribute_id, message_transport_type, is_digest, letter_module, letter_code) VALUES (6, 'sms', 1, 'circulation', 'CHECKOUTDGST');});
- $dbh->do(q{INSERT INTO message_transports (message_attribute_id, message_transport_type, is_digest, letter_module, letter_code) VALUES (6, 'feed', 1, 'circulation', 'CHECKOUTDGST');});
+ $dbh->do(q{INSERT INTO message_transports (message_attribute_id, message_transport_type, is_digest, letter_module, letter_code) VALUES (5, 'email', 0, 'circulation', 'CHECKIN');});
+ $dbh->do(q{INSERT INTO message_transports (message_attribute_id, message_transport_type, is_digest, letter_module, letter_code) VALUES (5, 'sms', 0, 'circulation', 'CHECKIN');});
+ $dbh->do(q{INSERT INTO message_transports (message_attribute_id, message_transport_type, is_digest, letter_module, letter_code) VALUES (6, 'email', 0, 'circulation', 'CHECKOUT');});
+ $dbh->do(q{INSERT INTO message_transports (message_attribute_id, message_transport_type, is_digest, letter_module, letter_code) VALUES (6, 'sms', 0, 'circulation', 'CHECKOUT');});
print "Upgrade to $DBversion done (data for Email Checkout Slips project)\n";
SetVersion ($DBversion);