Egg::View::Mail - View to transmit mail.
my $mail= $e->view('mail_label'); # Mail is transmitted. $mail->send( to => 'firstname.lastname@example.org', body => <<END_BODY ); Hello. !! END_BODY
It is a view to transmit mail.
To use it, the module is generated under the control of the project with the helper.
% cd /path/to/MyApp/bin % ./egg_helper V::Mail [MODULE_NAME]
'MyApp/View/Mail/MODULE_NAME.pm' is generated to the lib directory of the project with this.
And, 'Mail' is added to the VIEW setting of the project.
% vi /path/to/MyApp/lib/MyApp/config.pm ......... ... VIEW => ['Mail'],
The controller module generated when the project is started by this is set up and using it becomes possible.
The behavior at Mail Sending etc. can be customized by customizing the controller module generated in the helper script.
% vi /path/to/MyApp/lib/MyApp/View/Mail/Hoo.pm package MyApp::View::Mail::Hoo; use base qw/ Egg::View::Mail::Base /; __PACKAGE__->config( ..... ); __PACKAGE__->setup_plugin( ...... ); __PACKAGE__->setup_mailer( ...... ); __PACKAGE__->setup_template( ....... ); 1;
First of all, a necessary setting is done by 'config' method.
And, the plugin component is set up if necessary by 'setup_plugin'.
The name that omits the part of 'Egg::View::Mail::Plugin' is passed to the argument by the list.
__PACKAGE__->setup_plugin(qw/ EmbAgent PortCheck Lot /;
There is a thing that doesn't operate normally by the different opinion relation because there is the one to Orbaraid the same method according to the loaded plugin, too. In this case, please adjust the loading order and solve it.
Next, it is loading of Mailer system component.
To build in other components, the list is passed following Mailer system component. The name that omits the part of 'Egg::View::Mail' is passed.
__PACKAGE__->setup_mailer( SMTP => qw/ Encode::ISO2022JP MIME::Entity / );
The different opinion problem occurs in order by which here is loaded.
When the template is used, PATH of the template used by the label name and the default of the template engine used by 'setup_template' method is set.
__PACKAGE__->setup_template( Mason => 'mail/value.tt' );
The MAIL controller is not a necessary translation in each template. The purpose is to default of passing neither 'body' nor 'template' by 'send' method until becoming empty and to use it.
The object can be acquired in the label name set for the MAIL controller to be built into the project.
my $mail= $e->view('mail_label_name');
Please refer to the document of the module for a setting necessary in each component.
Label name to acquire MAIL controller object.
Default is 'mail:: MODULE_NAME'.
It defaults to the MAIL controller who set it and it treats.
There is especially not handling two or more MAIL controllers needing.
It is set when this setting is not in any when there are two or more MAIL controllers either by the result of sorting by the module name.
Mail Sending used by default ahead.
It comes to be able to set two or more destinations with ARRAY by using Egg::View::Mail::Plugin::Lot.
Mail source who uses it by default.
Subject of mail used by default.
Content of 'Reply-To' header.
Content of 'Return-Path' header.
Content of 'CC' header.
Content of 'BCC' header.
Content of 'X-Mailer' header.
Default is 'Egg::View::Mail v[VERSION]'.
It uses it to make the address of default. It is not necessary if 'to' and 'from' are set.
This module doesn't have the method that can be especially used.
Please refer to the document of Egg::View::Mail::Base of the MAIL controller base class.
The object of the MAIL controller of default is returned.
my $mail= $e->view('mail');
Masatoshi Mizuno <email@example.com>
Copyright (C) 2008 Bee Flag, Corp. <http://egg.bomcity.com/>, All Rights Reserved.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.6 or, at your option, any later version of Perl 5 you may have available.