#============================================================= -*-Perl-*-
#
# DSG::Template::Plugin::Mail::Sender
#
# DESCRIPTION
#
#   Simple Template Toolkit plugin interfacing to the Sender.pm module.
#
# AUTHOR
#   Terry Goldsworthy   <tgoldsworthy@descartes.com>
#
# COPYRIGHT
#   Copyright (C) 2000  Terry Goldsworthy.  All Rights Reserved.
#   Copyright (C) 2000  Descartes Systems Group
#
#   This module is free software; you can redistribute it and/or
#   modify it under the same terms as Perl itself.
#
#----------------------------------------------------------------------------
#
# $Id: Sender.pm,v 1.1 2000/06/26 15:36:06 tgoldsworthy Exp $
#
#============================================================================

package DSG::Template::Plugin::Mail::Sender;

require 5.004;

use strict;
use vars qw( @ISA $VERSION );
use Template::Plugin;
#use base qw( Template::Plugin );
use Mail::Sender;

#@ISA     = qw( Template::Plugin );
$VERSION = sprintf("%d.%02d", q$Revision: 1.1 $ =~ /(\d+)\.(\d+)/);

sub load {
    return $_[0];
}

sub new {
    my $class   = shift;
    my $context = shift;
    Mail::Sender->new(@_);
}

1;

__END__

=head1 NAME

Template::Plugin::Mail::Sender - simple Template Plugin interface to Sender.pm module

=head1 SYNOPSIS

    [% USE Mail.Sender %]

    [% USE msg = Mail.Sender %]
    [% msg.MailMsg({[from => "somebody@somewhere.com"]
                    [, to => "else@nowhere.com"] [...], msg => "Message"}) %]
    
    # see Sender docs for other methods provided by the Sender object

 [% USE Mail::Sender %]

 [% USE sender = Mail::Sender({smtp => 'mail.yourdomain.com', from => 'your@address.com'}) %]
 [% sender.MailFile({to => 'some@address.com',
                subject => 'Here is the file',
                    msg => "I'm sending you the list you wanted.",
                   file => 'filename.txt'}) %]


=head1 DESCRIPTION

This is a very simple Template Toolkit Plugin interface to the Sender module.
A Sender object will be instantiated via the following directive:

    [% USE Mail.Sender %]

Sender methods may then be called as follows:

    [% Mail.Sender.MailFile %]
    [% Mail.Sender.MailFile('parameter') %]

An alias can be used to provide an alternate name by which the object should
be identified.

    [% USE sender = Mail.Sender %]
    [% sender.MailFile({to => 'some@address.com',
                   subject => 'Here is the file',
                       msg => "I'm sending you the list you wanted.",
                       file => 'filename.txt'}) %]

=head1 AUTHOR

Terry Goldsworthy E<lt>descartes.comE<gt>

=head1 REVISION

$Revision: 1.1 $

=head1 COPYRIGHT

Copyright (C) 2000  Terry Goldsworthy.  All Rights Reserved.
Copyright (C) 2000  Descartes Systems Group

This module is free software; you can redistribute it and/or
modify it under the same terms as Perl itself.

=head1 SEE ALSO

L<Mail::Sender>, L<Template::Plugin|Template::Plugin>, 

=cut





