App::MonM::Notifier::Channel::File - monotifier file channel
Version 1.00
use App::MonM::Notifier::Channel; # Create channel object my $channel = new App::MonM::Notifier::Channel; # Send message via file channel $channel->file( { id => 1, to => "anonymous", from => "sender", subject => "Test message", message => "Content of the message", headers => { "X-Foo" => "Extended eXtra value", }, }, { encoding => 'base64', # Default: 8bit content_type => undef, # Default: text/plain charset => undef, # Default: utf-8 dir => '.', # Default: your temp directory filemask => "monotifier.msg", # Default: "[TO]_[ID]_[CRC16].[EXT]" }) or warn( $channel->error ); # See error print $channel->error unless $channel->status;
This module provides "file" method that writes the content of the message to an external file
my $status = $channel->file( $data, $options );
The $data structure (hashref) describes body of message, the $options structure (hashref) describes parameters of the connection via external modules
It is a structure (hash), that can contain the following fields:
Contains internal ID of the message. This ID is converted to an X-Id header
Recipient address or name
Sender address or name
Subject of the message
Body of the message
Optional field. Contains eXtra headers (extension headers). For example:
headers => { "bcc" => "bcc\@example.com", "X-Mailer" => "My mailer", }
Defines path to save the message file
Default: your temp directory
Defines special mask of the message's filename. The mask consists of directives like [NAME].
Supported directives:
- ID -- Internal ID of the message (see id field) - TO -- Normalized "to" field - CRC, CRC8, CRC16, CRC32 -- Check-codes of the message - EXT -- file extension (default: msg) - TIME -- Current time (in unix time format)
Default: "[TO]_[ID]_[CRC16].[EXT]"
About other options (base) see "OPTIONS" in App::MonM::Notifier::Channel
For internal use only!
Called from base class. Returns initialize structure
Called from base class. Returns status of the operation
See CHANGES file
CHANGES
CTK, Compress::Raw::Zlib
See TODO file
TODO
* none noted
App::MonM::Notifier, FileHandle, App::MonM::Notifier::Channel
Sergey Lepenkov (Serz Minus) http://www.serzik.com <abalama@cpan.org>
Copyright (C) 1998-2017 D&D Corporation. All Rights Reserved
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
See LICENSE file
LICENSE
To install App::MonM::Notifier, copy and paste the appropriate command in to your terminal.
cpanm
cpanm App::MonM::Notifier
CPAN shell
perl -MCPAN -e shell install App::MonM::Notifier
For more information on module installation, please visit the detailed CPAN module installation guide.