Changeset 181
- Timestamp:
- 04/11/09 02:39:36 (15 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MANIFEST
r180 r181 57 57 root/static/vote.css 58 58 root/mail/poll_request.tt 59 root/mail/ballot_confirm.tt 59 60 root/templates/admin/default.tt 60 61 root/templates/admin/denied.tt -
trunk/lib/Vote/Controller/Ballot.pm
r180 r181 117 117 $c->req->address, 118 118 ); # TODO trap error 119 $vote->mail_ballot_confirm($mail, $id, { 120 ballotid => $c->stash->{ballotid}, 121 url => $c->uri_for('/vote', $id), 122 }); 119 $c->forward( 120 q'Vote::View::Mail', 'render', 121 [ 'ballot_confirm.tt', { 122 From => $mail, 123 To => $mail, 124 Subject => 'Confirmation de vote: ' . $vote->vote_info($id)->{label}, 125 mail => { 126 ballotid => $c->stash->{ballotid}, 127 voteid => $id, 128 } 129 } ] 130 ); 131 123 132 $c->stash->{template} = 'ballot/done.tt'; 124 133 $c->delete_session('Vote terminé'); -
trunk/lib/Vote/Controller/Newpoll.pm
r180 r181 46 46 reqid => $reqid, 47 47 } 48 } ]); 48 } ] 49 ); 49 50 50 51 $c->stash->{template} = 'newpoll/request.tt'; -
trunk/lib/Vote/DB.pm
r180 r181 6 6 use warnings; 7 7 use Vote; 8 use Mail::Mailer;9 8 use base 'Vote::DB::common'; 10 9 use Vote::DB::Poll; … … 172 171 } 173 172 174 sub mail_ballot_confirm {175 my ($self, $vid, $voteid, $info) = @_;176 $self->poll($voteid)->mail_ballot_confirm($vid, $info);177 }178 179 173 sub vote_voting_count { 180 174 my ($self, $id) = @_; -
trunk/lib/Vote/DB/Poll.pm
r176 r181 6 6 use warnings; 7 7 use Vote; 8 use Mail::Mailer;9 8 use Crypt::RSA; 10 9 use Crypt::RSA::Key::Public::SSH; … … 446 445 } 447 446 448 sub mail_ballot_confirm {449 my ($self, $vid, $info) = @_;450 my $voteinfo = $self->info or return;451 $info->{ballotid} or return;452 my $mailer = new Mail::Mailer 'smtp', Server => (Vote->config->{smtp} || 'localhost');453 $ENV{MAILADDRESS} = $vid;454 $mailer->open({455 From => $vid, # TODO allow to configure this456 To => $vid,457 Subject => 'Confirmation de vote: ' . $voteinfo->{label},458 Vote::DB::common::mail_header(),459 });460 print $mailer <<EOF;461 462 Vous venez de participer au vote:463 464 --------465 $voteinfo->{label}466 --------467 468 Votre bulletin est idéntifié sous le numéro:469 $info->{ballotid}470 471 Les résultats seront disponibles à cet url:472 $info->{url}473 474 Cordialement.475 EOF476 $mailer->close477 or warn "couldn't send whole message: $!\n";478 479 }480 481 447 sub voting_count { 482 448 my ($self) = @_;
Note: See TracChangeset
for help on using the changeset viewer.