#!/usr/bin/perl

use strict;
use warnings;
use Getopt::Long qw(:config no_ignore_case);
use Perun::Agent;
use Perun::Common qw(printMessage); 

sub help {
return qq{
Removes NotifTemplate from db by id. Id is required field.
------------------------------------
Available options:
 --NotifTemplateId        | -i id of the NotifTemplate
 --batch                  | -b batch
 --help                   | -h prints this help
 
};
}

our $batch;
my $id;
GetOptions ("help|h" => sub { print help(); exit 0;} ,"batch|b" => \$batch, 
 "NotifTemplateId|i=i" => \$id) || die help(); 

# Check options
unless (defined($id)) {die "ERROR: NotifTemplate: id is required\n";}

my $agent = Perun::Agent->new();
my $notifAgent = $agent->getNotificationsAgent;

$notifAgent->removePerunNotifTemplateById(id => $id);

printMessage("NotifTemplate Id:$id successfully removed.", $batch);
