- Timestamp:
- 03/19/09 16:54:46 (15 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/Vote/Model/Vote.pm
r86 r87 38 38 39 39 sub db { $_[0]->{db} } 40 41 sub mail_header { 42 return( 43 'Content-Type' => 'text/plain; charset=UTF-8; format=flowed', 44 'Content-Transfer-Encoding' => '8bit', 45 'X-Epoll-version' => $Vote::VERSION, 46 ); 47 } 40 48 41 49 sub random_string { … … 769 777 770 778 # TODO complete this properly: 771 my $mailer = new Mail::Mailer 'smtp', Server => 'mailhost';779 my $mailer = new Mail::Mailer 'smtp', Server => (Vote->config->{smtp} || 'localhost'); 772 780 $mailer->open({ 773 781 From => $voteinfo->{owner}, … … 775 783 Subject => 'Invitation a voter: ' . $voteinfo->{label}, 776 784 'X-Epoll-poll' => $id, 777 'X-Epoll-version' => $Vote::VERSION,785 mail_header(), 778 786 }); 779 787 print $mailer <<EOF; 780 Vous etes convie à participer a ce vote: 788 Vous êtes convié à participer a ce vote: 789 790 -------- 781 791 $voteinfo->{label} 782 783 a l'adresse: 792 -------- 793 794 à l'adresse: 784 795 785 796 $mailinfo->{voteurl} … … 788 799 Votre mot de passe est: $passwd 789 800 790 Conserver pr ecieusement ces identifiants, il ne vous seront pas redonner.801 Conserver précieusement ces identifiants, il ne vous seront pas retransmit. 791 802 792 803 Cordialement. 793 804 EOF 794 $mailer->close ;805 $mailer->close or warn "couldn't send whole message: $!\n"; 795 806 796 807 $self->db->commit; … … 854 865 855 866 $addreq->execute($reqid, $info{label}, $info{mail}); 856 my $mailer = new Mail::Mailer 'smtp', Server => 'mailhost';867 my $mailer = new Mail::Mailer 'smtp', Server => (Vote->config->{smtp} || 'localhost'); 857 868 $mailer->open({ 858 869 From => 'Voting system <nomail@nomail.com>', # TODO allow to configure this 859 870 To => $info{mail}, 860 871 Subject => 'Votre nouveau vote', 872 mail_header(), 861 873 }); 862 874 print $mailer <<EOF; … … 868 880 $info{url}/$reqid 869 881 870 A bient ot882 A bientÃŽt 871 883 EOF 872 $mailer->close; 884 $mailer->close 885 or warn "couldn't send whole message: $!\n"; 873 886 $self->db->commit; 874 887 1; -
trunk/vote.yml.example
r5 r87 2 2 name: Vote 3 3 db: dbname=vote 4 -- The smtp serveur to use 5 smtp:
Note: See TracChangeset
for help on using the changeset viewer.