--- trunk/lib/App/RoomReservation/Confirmation.pm 2009/06/30 15:10:55 1133 +++ trunk/lib/App/RoomReservation/Confirmation.pm 2009/06/30 15:59:41 1134 @@ -3,6 +3,8 @@ extends 'App::RoomReservation'; +with 'App::RoomReservation::Email'; + has token => ( is => 'ro', isa => 'Str', @@ -36,19 +38,34 @@ if ( $sth->rows == 1 ) { $sth = $dbh->prepare(qq{ - select ime||' '||prezime,_seat_number + select ime||' '||prezime,_seat_number,email from reservation where md5(id||email) = ? and _confirmed is true and _seat_number is not null }); $sth->execute( $self->token ); - my ($name, $seat) = $sth->fetchrow_array; + my ($name, $seat, $email) = $sth->fetchrow_array; + my $html = qq| $name, reservation has been confirmed and seat number $seat is waiting for you.
Please print this notice and show it when entering lecture. |; + + my $token = $self->token; + $self->send( $email, + "Lecture seat $seat is assigned to you", + $html . <<__EMAIL__ + +If you wish to cancel your reservation please click on link below: + +http://FREY_HOSTNAME/App::RoomReservation::Confirmation/cancel_as_markup?token=$token +__EMAIL__ + ); + + return $html; + } else { die "Problem with confirmation.\n"; }