3 |
|
|
4 |
extends 'App::RoomReservation'; |
extends 'App::RoomReservation'; |
5 |
|
|
6 |
|
with 'App::RoomReservation::Email'; |
7 |
|
|
8 |
has token => ( |
has token => ( |
9 |
is => 'ro', |
is => 'ro', |
10 |
isa => 'Str', |
isa => 'Str', |
38 |
if ( $sth->rows == 1 ) { |
if ( $sth->rows == 1 ) { |
39 |
|
|
40 |
$sth = $dbh->prepare(qq{ |
$sth = $dbh->prepare(qq{ |
41 |
select ime||' '||prezime,_seat_number |
select ime||' '||prezime,_seat_number,email |
42 |
from reservation |
from reservation |
43 |
where md5(id||email) = ? and _confirmed is true and _seat_number is not null |
where md5(id||email) = ? and _confirmed is true and _seat_number is not null |
44 |
}); |
}); |
45 |
|
|
46 |
$sth->execute( $self->token ); |
$sth->execute( $self->token ); |
47 |
my ($name, $seat) = $sth->fetchrow_array; |
my ($name, $seat, $email) = $sth->fetchrow_array; |
48 |
|
|
49 |
|
my $html = |
50 |
qq| |
qq| |
51 |
$name, <em>reservation has been confirmed</em> and seat number <big>$seat</big> is waiting for you. |
$name, <em>reservation has been confirmed</em> and seat number <big>$seat</big> is waiting for you. |
52 |
<br> |
<br> |
53 |
Please print this notice and show it when entering lecture. |
Please print this notice and show it when entering lecture. |
54 |
|; |
|; |
55 |
|
|
56 |
|
my $token = $self->token; |
57 |
|
$self->send( $email, |
58 |
|
"Lecture seat $seat is assigned to you", |
59 |
|
$html . <<__EMAIL__ |
60 |
|
|
61 |
|
If you wish to cancel your reservation please click on link below: |
62 |
|
|
63 |
|
http://FREY_HOSTNAME/App::RoomReservation::Confirmation/cancel_as_markup?token=$token |
64 |
|
__EMAIL__ |
65 |
|
); |
66 |
|
|
67 |
|
return $html; |
68 |
|
|
69 |
} else { |
} else { |
70 |
die "Problem with confirmation.\n"; |
die "Problem with confirmation.\n"; |
71 |
} |
} |