SET @leave_apply_notification_id := (SELECT id FROM ohrm_notification WHERE name = 'Leave Applications');
SET @leave_assign_notification_id := (SELECT id FROM ohrm_notification WHERE name = 'Leave Assignments');
SET @leave_approve_notification_id := (SELECT id FROM ohrm_notification WHERE name = 'Leave Approvals');
SET @leave_cancel_notification_id := (SELECT id FROM ohrm_notification WHERE name = 'Leave Cancellations');
SET @leave_reject_notification_id := (SELECT id FROM ohrm_notification WHERE name = 'Leave Rejections');
SET @leave_change_notification_id := (SELECT id FROM ohrm_notification WHERE name = 'Leave Change Email');

INSERT INTO `ohrm_ics_calendar_invitation_processor` (`notification_id` ,`processor`, `is_enabled`, `calendar_method`, `status`, `opacity`) VALUES
(@leave_assign_notification_id, 'LeaveIcsInvitationProcessor', '1', 'REQUEST', 'CONFIRMED', 'OPAQUE'),
(@leave_approve_notification_id, 'LeaveIcsInvitationProcessor', '1', 'REQUEST', 'CONFIRMED', 'OPAQUE'),
(@leave_cancel_notification_id, 'LeaveIcsInvitationProcessor', '1', 'CANCEL', 'CANCELLED', 'TRANSPARENT'),
(@leave_reject_notification_id, 'LeaveIcsInvitationProcessor', '0', 'CANCEL', 'CANCELLED', 'TRANSPARENT'),
(@leave_change_notification_id, 'ChangeLeaveIcsInvitationProcessor', '0', NULL, NULL, NULL);

INSERT INTO `ohrm_ics_calendar_content_template` (`notification_id` ,`organizer` ,`recipient` ,`summary_text` ,`description_text`) VALUES
( @leave_assign_notification_id, NULL, NULL, '%leave_type% - %leave_status%', 'Please access the below link for further action or information\n %leave_request_link%'),
( @leave_approve_notification_id, NULL, NULL, '%leave_type% - %leave_status%', 'Please access the below link for further action or information\n %leave_request_link%'),
( @leave_cancel_notification_id, NULL, NULL, '%leave_type% - %leave_status%', 'Please access the below link for further action or information\n %leave_request_link%'),
( @leave_reject_notification_id, NULL, NULL, '%leave_type% - %leave_status%', 'Please access the below link for further action or information\n %leave_request_link%'),
( @leave_change_notification_id, NULL, NULL, '%leave_type% - %leave_status%', 'Please access the below link for further action or information\n %leave_request_link%');