[Solved] Default appointment notification template

Moderator: crythias

Post Reply
tpsupport
Znuny newbie
Posts: 75
Joined: 02 Feb 2011, 14:45
Znuny Version: 6.0.12

[Solved] Default appointment notification template

Post by tpsupport »

Hi everyone,

we have a calendar per agent and in these calendars there is a ticket appointment rule that filters for tickets with a specific dynamic date/time field and the respective agent that the calendar belongs to as "responsible". The agents have their public calendar in outlook which works great but without any notification time set. I like the idea of automatic appointment creation but also need to have a notification set.

Is there any way to set a default notification for appointments or better only ticket appointments?

AppointmentNotificationTemplate.PNG

Many thanks in advance!
You do not have the required permissions to view the files attached to this post.
Last edited by tpsupport on 26 Oct 2018, 15:33, edited 1 time in total.
Znuny 6.5 LTS - Ubuntu 20.04 x64, Azure Database for MySQL server 5.7, Perl 5.22.1, Apache/2.4.18
tpsupport
Znuny newbie
Posts: 75
Joined: 02 Feb 2011, 14:45
Znuny Version: 6.0.12

Re: Default appointment notification template

Post by tpsupport »

I have solved this issue by copying "Kernel/System/Calendar/Appointment.pm" to "Custom/Kernel/System/Calendar/Appointment.pm" (create missing folders if needed) and editing the part where it checks whether a NotificationTemplate has been set. If there is nothing set for the Appointment then the template value "Start" will be set. See changes below.

Note!: This change affects all appointments that will be created without notification.

Code: Select all

    
    # reset notification data if needed
    if ( !$Param{Data}->{NotificationTemplate} ) {

        for my $PossibleParam (
            qw(
            NotificationDate NotificationTemplate NotificationCustom NotificationCustomRelativeUnitCount
            NotificationCustomRelativeUnit NotificationCustomRelativePointOfTime NotificationCustomDateTime
            )
            )
        {
            $Param{Data}->{$PossibleParam} = undef;           
        }
     #
     # Ticket Notification customization START 
     #
  
     # Set appointment notification at 'Start'
     $Param{Data}->{NotificationTemplate} ||= 'Start';   

     #
     # Ticket Notification customization END 
     #
}
Znuny 6.5 LTS - Ubuntu 20.04 x64, Azure Database for MySQL server 5.7, Perl 5.22.1, Apache/2.4.18
Post Reply