The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

App::MonM::QNotifier - The MonM Quick Notification Subsystem

VERSION

Version 1.01

SYNOPSIS

    use App::MonM::QNotifier;

DESCRIPTION

This is an extension for the monm notifications

new

    my $notifier = App::MonM::QNotifier->new(
            config => $app->configobj,
        );

channel

    my $channel = $notifier->channel;

Returns App::MonM::Channel object

config

    my $configobj = $notifier->config;

Returns CTK config object

error

    my $error = $notifier->error;

Returns error string

    $notifier->error( "error text" );

Sets error string

getChanelsBySendTo

    my @channels = $notifier->getChanelsBySendTo("user1, my@example.com, 123456789");

Resolves the "SendTo" recipients and takes channels for each from it

getGroups

    my @groups = $notifier->getGroups;

Returns allowed groups

getUsers

    my @users = $notifier->getUsers;

Returns allowed users

getUsersByGroup

    my @users = $notifier->getUsersByGroup("wheel");

Returns users of specified group

notify

    $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

remind

Tries to send postponed messages

HISTORY

See Changes file

TO DO

See TODO file

SEE ALSO

App::MonM::Notifier

AUTHOR

Serż Minus (Sergey Lepenkov) https://www.serzik.com <abalama@cpan.org>

COPYRIGHT

Copyright (C) 1998-2022 D&D Corporation. All Rights Reserved

LICENSE

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/