App::MonM::QNotifier - The MonM Quick Notification Subsystem
Version 1.01
use App::MonM::QNotifier;
This is an extension for the monm notifications
my $notifier = App::MonM::QNotifier->new( config => $app->configobj, );
my $channel = $notifier->channel;
Returns App::MonM::Channel object
my $configobj = $notifier->config;
Returns CTK config object
my $error = $notifier->error;
Returns error string
$notifier->error( "error text" );
Sets error string
my @channels = $notifier->getChanelsBySendTo("user1, my@example.com, 123456789");
Resolves the "SendTo" recipients and takes channels for each from it
my @groups = $notifier->getGroups;
Returns allowed groups
my @users = $notifier->getUsers;
Returns allowed users
my @users = $notifier->getUsersByGroup("wheel");
Returns users of specified group
$notifier->notify( to => ['@FooGroup, @BarGroup, testuser, foo@example.com, 11231230002'], subject => "Test message", message => "Text of test message", before => sub { my $self = shift; # App::MonM::QNotifier object (this) my $message = shift; # App::MonM::Message object # ... return 1; }, after => sub { my $self = shift; # App::MonM::QNotifier object (this) my $message = shift; # App::MonM::Message object my $sent = shift; # Status of sending die ( $self->channel->error ) unless $sent; # ... return 1; }, ) or die($notifier->error);
Sends message (text of message) to recipients list
The callback function "before" calls before the message sending. Must be return the true value. The callback function "after" calls after the message sending. Must be return the true value
Tries to send postponed messages
See Changes file
Changes
See TODO file
TODO
App::MonM::Notifier
Serż Minus (Sergey Lepenkov) https://www.serzik.com <abalama@cpan.org>
Copyright (C) 1998-2022 D&D Corporation. All Rights Reserved
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
See LICENSE file and https://dev.perl.org/licenses/
LICENSE
To install App::MonM, copy and paste the appropriate command in to your terminal.
cpanm
cpanm App::MonM
CPAN shell
perl -MCPAN -e shell install App::MonM
For more information on module installation, please visit the detailed CPAN module installation guide.