Changeset 1011 for trunk/LATMOS-Accounts/lib
- Timestamp:
- 05/21/12 19:37:04 (12 years ago)
- Location:
- trunk/LATMOS-Accounts/lib/LATMOS/Accounts
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LATMOS-Accounts/lib/LATMOS/Accounts/Bases/Sql/DataRequest.pm
r1004 r1011 284 284 285 285 if ($lamail->process( 286 {}, # no variables287 286 \%mail, 288 287 )) { -
trunk/LATMOS-Accounts/lib/LATMOS/Accounts/Mail.pm
r990 r1011 10 10 use FindBin qw($Bin); 11 11 use Sys::Hostname; 12 13 =head1 NAME 14 15 LATMOS::Accounts::Mail - Send mail using Template 16 17 =head1 SYNOPSIS 18 19 use LATMOS::Accounts::Mail; 20 # Prepare the mail 21 my $mail = LATMOS::Accounts::Mail->new( 22 $la, 23 'foo.mail', 24 { 25 'Subject' => 'a mail', 26 } 27 ); 28 # Send it 29 $mail->process({}, { to => 'dest@domain' }); 30 31 =head1 FUNCTIONS 32 33 =cut 34 35 =head2 LATMOS::Accounts::Mail->new($la, $template, $header) 36 37 Create a new C<LATMOS::Accounts::Mail> object. C<$la> is a reference to 38 a C<LATMOS::Accounts> object, C<$template> is the name of the template to use, 39 C<$header> is a hashref containing default mail header to use when sending mail. 40 41 =cut 12 42 13 43 sub new { … … 32 62 } 33 63 64 =head2 $lamail->process($headers, $vars) 65 66 Process the template as mail body and send the mail. 67 68 C<$headers> is a hashref to header to use to send the mail (See 69 L<Mail::Sendmail>. 70 71 C<$var> is a hashref to be used by L<Template>. 72 73 =cut 74 34 75 sub process { 35 my ($self, $vars, $headers) = @_; 76 my ($self, $headers, $vars) = @_; 77 78 $vars ||= {}; 36 79 37 80 my $message; … … 79 122 } 80 123 124 =head1 SEE ALSO 125 126 L<Template>, L<Mail::Sendmail> 127 128 =head1 AUTHOR 129 130 Thauvin Olivier, E<lt>olivier.thauvin@latmos.ipsl.fr<gt> 131 132 =head1 COPYRIGHT AND LICENSE 133 134 Copyright (C) 2012 by Thauvin Olivier 135 136 This library is free software; you can redistribute it and/or modify 137 it under the same terms as Perl itself, either Perl version 5.10.0 or, 138 at your option, any later version of Perl 5 you may have available. 139 140 =cut 141 81 142 1; -
trunk/LATMOS-Accounts/lib/LATMOS/Accounts/Maintenance.pm
r990 r1011 110 110 ); 111 111 my $message; 112 if ($lamail->process( $user, \%mail)) {112 if ($lamail->process(\%mail, $user)) { 113 113 la_log(LA_NOTICE, "Expiration mail for %s (%s) sent to %s; cc %s", 114 114 $user->{obj}->id, … … 132 132 my %mail = ( 133 133 ); 134 if ($summail->process({ }, {134 if ($summail->process({ 135 135 Subject => 'LATMOS account expiration summary', 136 136 To => $self->val('_default_', 'expire_summary_to'), … … 185 185 ); 186 186 $mail{to} = $options{to} || $mail; 187 if ($lamail->process( $managers{$oman->id}, \%mail)) {187 if ($lamail->process(\%mail, $managers{$oman->id})) { 188 188 la_log(LA_NOTICE, 189 189 "Expired account reminder mail for %s sent to %s (cc: %s) for %s", … … 223 223 $self, \join('', @summary), {} 224 224 ); 225 if ($summail->process( {},\%mail)) {225 if ($summail->process(\%mail)) { 226 226 la_log(LA_NOTICE, "Expiration summary mail sent to %s", 227 227 $self->val('_default_', 'expire_summary_to'),
Note: See TracChangeset
for help on using the changeset viewer.