« Jifty/View/Declare/Page.pm
↑ Summary
Jifty/Plugin/Authentication/Password/Notification/ConfirmLostPassword.pm »
| 1 | use warnings; | ||
| 2 | use strict; | ||
| 3 | |||
| 4 | package Jifty::Plugin::Authentication::Password::Notification::ConfirmEmail; | ||
| 5 | use base qw/Jifty::Notification/; | ||
| 6 | |||
| 7 | =head1 NAME | ||
| 8 | |||
| 9 | Jifty::Plugin::Authentication::Password::Notification::ConfirmEmail - mail notification to confirm email | ||
| 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 | |||
| 26 | my $LoginUser = Jifty->app_class('Model', 'User'); | ||
| 27 | |||
| 28 | unless ( UNIVERSAL::isa($self->to, $LoginUser) ){ | ||
| 29 | $self->log->error((ref $self) . " called with invalid user argument"); | ||
| 30 | return; | ||
| 31 | } | ||
| 32 | |||
| 33 | |||
| 34 | my $letme = Jifty::LetMe->new(); | ||
| 35 | $letme->email($self->to->email); | ||
| 36 | $letme->path('confirm_email'); | ||
| 37 | my $confirm_url = $letme->as_url; | ||
| 38 | my $appname = Jifty->config->framework('ApplicationName'); | ||
| 39 | |||
| 40 | $self->subject( _("Welcome to %1!",$appname )); | ||
| 41 | $self->body(_(" | ||
| 42 | You're getting this message because you (or somebody claiming to be you) | ||
| 43 | wants to use %1. | ||
| 44 | |||
| 45 | We need to make sure that we got your email address right. Click on the link below to get started: | ||
| 46 | |||
| 47 | %2 | ||
| 48 | ",$appname,$confirm_url)); | ||
| 49 | |||
| 50 | } | ||
| 51 | |||
| 52 | 1; |