App-ZofCMS

 view release on metacpan or  search on metacpan

lib/App/ZofCMS/Plugin/HTMLMailer.pm  view on Meta::CPAN

            filename            => 'mail-templates/email-template.tmpl',
            die_on_bad_params   => 0,
        ),
    ...

B<Optional>. Takes an L<HTML::Template> object (or something that behaves
like one). If specified, the C<template> and C<template_dir> arguments
will be ignored and the object you specify will be used instead. B<Note:>
the default L<HTML::Template> object (used when C<html_template_object>
is B<not> specified) has C<die_on_bad_params> argument set to a false
value; using C<html_template_object> you can change that.
B<By default> is not specified.

=head3 C<attach>

    plug_htmlmailer => {
        attach => [
            Type     => 'image/gif',
            Path     => 'aaa000123.gif',
            Filename => 'logo.gif',
            Disposition => 'attachment'
        ],
    ...

    plug_htmlmailer => {
        attach => [
            [
                Type     => 'image/gif',
                Path     => 'aaa000123.gif',
                Filename => 'logo1.gif',
                Disposition => 'attachment'
            ],
            [
                Type     => 'TEXT',
                Data     => "Here's the GIF file you wanted"
            ],
        ],
    ...

    plug_htmlmailer => {
        attach => sub {
            my ( $t, $q, $config ) = @_;
            return [
                Type     => 'TEXT',
                Data     => "Here's the GIF file you wanted"
            ];
        }
    ...

B<Optional>. Provides access to the C<attach> method of L<MIME::Lite>, e.g.
gives you an ability to attach files to your emails.
Takes an arrayref, an arrayref of arrayrefs, or a subref as a value. If an arrayref is
specified, plugin will create a single-item arrayref with it (so it'll be nested); if an
arrayref of arrayrefs is specified, each of its arrayrefs will be interpreted as a
list of arguments to pass to C<attach> method. If a subref is specified, its return
value will be assigned to the C<attach> key and its C<@_> array will contain:
C<$t>, C<$q>, C<$config> (in that order) where C<$t> is ZofCMS Template
hashref, C<$q> is the query parameter hashref and C<$config> is the
L<App::ZofCMS::Config> object. B<Default:> not specified

=head1 OUTPUT

This plugin doesn't produce any output and doesn't set any keys.

=head1 A WARNING ABOUT ERRORS

This plugin doesn't have any error handling. The behaviour is completely
undefined in cases of: invalid email addresses, improper or
insufficient C<mime_lite_params> values, no C<from> set, etc. For example,
on my system, not specifying any C<mime_lite_params> makes it look
like plugin is not running at all. If things go awry: copy the plugin's
code into your projects dir
(C<zofcms_helper --nocore --site YOUR_PROJECT --plugins HTMLMailer>) and
mess around with code to see what's wrong (the code would be located in
C<YOUR_PROJECT_site/App/ZofCMS/Plugin/HTMLMailer.pm>)

=head1 REPOSITORY

Fork this module on GitHub:
L<https://github.com/zoffixznet/App-ZofCMS>

=head1 BUGS

To report bugs or request features, please use
L<https://github.com/zoffixznet/App-ZofCMS/issues>

If you can't access GitHub, you can email your request
to C<bug-App-ZofCMS at rt.cpan.org>

=head1 AUTHOR

Zoffix Znet <zoffix at cpan.org>
(L<http://zoffix.com/>, L<http://haslayout.net/>)

=head1 LICENSE

You can use and distribute this module under the same terms as Perl itself.
See the C<LICENSE> file included in this distribution for complete
details.

=cut



( run in 0.568 second using v1.01-cache-2.11-cpan-5623c5533a1 )