CatalystX::Usul::TraitFor::Email - Role for sending emails
Describes v0.17.$Rev: 1 $
package YourApp::Model::YourModel; use CatalystX::Usul::Moose; extends qw(CatalystX::Usul::Model); with qw(CatalystX::Usul::TraitFor::Email); sub your_method { my $self = shift; $recipient = $self->send_email( $args ); return; }
Provides utility methods to the model and program base classes
Requires the loc method
loc
$recipient = $self->send_email( $args );
Sends emails. Returns the recipient address, throws on error. The $args hash ref uses these keys:
$args
A hash ref whose key/value pairs are the attachment name and path name. Encoding and content type are derived from the file name extension
A hash ref that is applied to email when it is created. Typical keys are; content_type and charset
Text for the body of the email message
Email address of the sender
Which mailer should be used to send the email. Defaults to SMTP
Which host should send the email. Defaults to localhost
Hash ref used by the template rendering to supply values for variable replacement
Subject string
If it exists then the template is rendered and used as the body contents
Email address of the recipient
None
There are no known incompatibilities in this module
There are no known bugs in this module. Please report problems to the address below. Patches are welcome
Peter Flanigan, <Support at RoxSoft.co.uk>
<Support at RoxSoft.co.uk>
Copyright (c) 2014 Peter Flanigan. All rights reserved
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See perlartistic
This program is distributed in the hope that it will be useful, but WITHOUT WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE
To install CatalystX::Usul, copy and paste the appropriate command in to your terminal.
cpanm
cpanm CatalystX::Usul
CPAN shell
perl -MCPAN -e shell install CatalystX::Usul
For more information on module installation, please visit the detailed CPAN module installation guide.