« Jifty/Plugin/Authentication/Password/Notification/ConfirmEmail.pm
↑ Summary
Jifty/Plugin/Config.pm »
| 1 | use warnings; | ||
| 2 | use strict; | ||
| 3 | |||
| 4 | package Jifty::Plugin::Authentication::Password::Notification::ConfirmLostPassword; | ||
| 5 | use base qw/Jifty::Notification/; | ||
| 6 | |||
| 7 | =head1 NAME | ||
| 8 | |||
| 9 | Jifty::Plugin::Authentication::Password::Notification::ConfirmLostPassword - mail notification to change password | ||
| 10 | |||
| 11 | =head1 ARGUMENTS | ||
| 12 | |||
| 13 | C<to>, a L<$YourApp::Model::User> whose address we are confirming. | ||
| 14 | |||
| 15 | =cut | ||
| 16 | |||
| 17 | =head2 setup | ||
| 18 | |||
| 19 | Sets up the fields of the message. | ||
| 20 | |||
| 21 | =cut | ||
| 22 | |||
| 23 | sub setup { | ||
| 24 | my $self = shift; | ||
| 25 | my $LoginUser = Jifty->app_class('Model', 'User'); | ||
| 26 | |||
| 27 | unless ( UNIVERSAL::isa($self->to, $LoginUser) ){ | ||
| 28 | $self->log->error((ref $self) . " called with invalid user argument"); | ||
| 29 | return; | ||
| 30 | } | ||
| 31 | |||
| 32 | my $letme = Jifty::LetMe->new(); | ||
| 33 | $letme->email($self->to->email); | ||
| 34 | $letme->path('reset_lost_password'); | ||
| 35 | my $confirm_url = $letme->as_url; | ||
| 36 | my $appname = Jifty->config->framework('ApplicationName'); | ||
| 37 | |||
| 38 | $self->body(_(" | ||
| 39 | You're getting this message because you (or somebody claiming to be you) | ||
| 40 | request to reset your password for %1. | ||
| 41 | |||
| 42 | If you don't want to reset your password just ignore this message. | ||
| 43 | |||
| 44 | To reset your password, click on the link below: | ||
| 45 | |||
| 46 | %2 | ||
| 47 | ",$appname,$confirm_url)); | ||
| 48 | |||
| 49 | } | ||
| 50 | |||
| 51 | 1; | ||
| 52 |