1 |
package App::RoomReservation::Messages; |
2 |
use Moose::Role; |
3 |
|
4 |
sub seat_confirmation_message { |
5 |
my ( $self, $col, $value ) = @_; |
6 |
|
7 |
die "wrong column name $col = $value" unless $col =~ m{^(token|email)$}; |
8 |
|
9 |
$col =~ s{token}{md5(id||email)}; |
10 |
|
11 |
my $sth = $self->dbh->prepare(qq{ |
12 |
select |
13 |
ime||' '||prezime, |
14 |
_seat_number, |
15 |
email, |
16 |
md5(id||email) as token, |
17 |
_confirmed, |
18 |
_canceled |
19 |
from reservation |
20 |
where |
21 |
$col = ? |
22 |
}); |
23 |
|
24 |
$sth->execute( $value ); |
25 |
|
26 |
die qq|<error>Can't find user $col = $value</error>| if $sth->rows == 0; |
27 |
|
28 |
my ( $name, $seat, $email, $token, $confirmed, $canceled ) = $sth->fetchrow_array; |
29 |
|
30 |
if ( $confirmed && $canceled ) { |
31 |
|
32 |
my $html = |
33 |
qq| |
34 |
<br><br> |
35 |
$name, |
36 |
<br><br> |
37 |
<em>Vas dolazak na predavanje je odjavljen i ne mozete se vise prijaviti.</em> |
38 |
<br> |
39 |
<em>Your registration has been canceled. You can not register again.</em> |
40 |
<br><br> |
41 |
Ako ste to ucinili greskom a ipak zelite prisustvovati predavanju, |
42 |
molimo da nas kontaktirate e-mailom. |
43 |
<br><br> |
44 |
If you canceled your registration for the lecture by mistake please |
45 |
contact us by e-mail. |
46 |
|; |
47 |
|
48 |
$self->send( $email, |
49 |
"Dolazak odjavljen / Registration canceled", |
50 |
$html |
51 |
); |
52 |
|
53 |
return $html; |
54 |
|
55 |
} elsif ( $confirmed ) { |
56 |
|
57 |
my $url = $self->url_for( 'Confirmation/cancel_as_markup?token=', $token ); |
58 |
|
59 |
my ($pending_rank) = $self->dbh->selectrow_array(qq{ select count(*) - 600 from reservation }); # FIXME ugly hard-coded cludge! |
60 |
|
61 |
my $html = |
62 |
( $seat |
63 |
? qq| |
64 |
<big>Potvrda o uspjesnoj prijavi za predavanje profesora Philipa Zimbarda "The Lucifer Effect"</big><br> |
65 |
<big>Confirmation - successful registration for Philip Zimbardo's lecture "The Lucifer Effect"</big> |
66 |
<br><br> |
67 |
<big>Ime i prezime / Name and surname : $name</big> |
68 |
<br><br> |
69 |
<big>Broj prijave / Registration number : $seat</big>. |
70 |
<br><br> |
71 |
|
72 |
Predavanje ce se odrzati 28. rujna 2009. u 12 sati u Kristalnoj dvorani hotela Westin, ulica Krsnjavoga 1, Zagreb.<br><br> |
73 |
Ova potvrda sadrzi vas registracijski broj. Potvrdu ispisite na pisacu i obavezno donesite sa sobom na predavanje jer je to vasa ulaznica i trazit ce se da ju predate prilikom ulaza u dvoranu. Ulaz u dvoranu biti ce moguc od 11,30 do 12,00 kad ce se zatvoriti vrata. Pozivamo vas da na vrijeme zauzmete mjesto u dvorani.<br><br> |
74 |
Tijekom rujna cemo vam poslati podsjetnik na predavanje te zamoliti da, ukoliko iz nekog razloga ne mozete doci na predavanje, odjavite svoj dolazak kako biste omogucili zainteresiranima s liste cekanja da ipak dođu na predavanje. U toj poruci dobit cete link uz pomoc kojeg cete moci jednostavno odjaviti svoj dolazak.<br><br> |
75 |
Dobro dosli!<br><br> |
76 |
Odsjek za psihologiju Filozofskog fakulteta Sveucilista u Zagrebu<br><br> |
77 |
|
78 |
----<br><br> |
79 |
|
80 |
The lecture will take place on 28th Sept 2009 at 12h at the Crystal Ballroom of the Hotel Westin Zagreb, 1 Izidor Krsnjavi Street, Zagreb.<br><br> |
81 |
|
82 |
This confirmation (voucher) includes your registration number and serves as your ticket. Please don’t forget to print this confirmation (voucher) and bring it with you when arriving to the lecture. Entrance to the hall will begin from 11.30h and continue till 12.00h. We kindly ask you to take your seat in the hall before noon.<br><br> |
83 |
|
84 |
During September you will receive a reminder notice. If you are, for any reason, unable to attend the lecture please un-register your attendance to allow other people from the waiting list to attend the lecture. You will receive e-mail message with the link for easy cancellation.<br><br> |
85 |
|
86 |
|
87 |
Welcome!<br><br> |
88 |
|
89 |
|
90 |
Department of Psychology<br> |
91 |
Faculty of Humanities and Social Sciences<br> |
92 |
University of Zagreb |
93 |
|
94 |
| : qq| |
95 |
|
96 |
Na žalost sva mjesta za predavanje profesora Philipa Zimbarda "The Licifer Effect" su trenutno već popunjena. <b>Vi ste $pending_rank. na listi čekanja.</b> Dakle, još nije sve izgubljeno! Ukoliko netko od osoba koje su ranije rezervirale ulaznicu u međuvremenu odustane, moći ćete prisustvovati predavanju.<br><br> |
97 |
|
98 |
Tijekom rujna ćemo svim prijavljenima poslati podsjetnik na predavanje te zamoliti da, ukoliko iz nekog razloga ne planiraju doći na predavanje, odjave svoj dolazak kako bi time omogućili zainteresiranima na listi čekanja da ipak dođu na predavanje. Kad i ako se mjesto oslobodi automatski cete dobiti potvtdu o uspješnoj prijavi za predavanje s vašim brojem regisracije. Taj e-mail ispišite na pisaču i obavezno donesite sa sobom jer je to vaša ulaznica.<br><br> |
99 |
|
100 |
Odsjek za psihologiju Filozofskog fakulteta Sveučilišta u Zagrebu<br><br> |
101 |
|
102 |
----<br><br> |
103 |
|
104 |
Unfortunately, all the seats for professor Philip Zimbardo's lecture "The Lucifer Effect" are already taken. <b>You are number $pending_rank on the waiting list.</b> Therefore, there is still a chance you will get your seat! If people who booked the seat earlier cancel their registration, people like you on the waiting list will get a chance to attend the lecture.<br><br> |
105 |
|
106 |
During September we will send a reminder to every participant and ask them to un-register if they are not able to attend the lecture, which will allow others from the waiting list to get a seat.<br><br> If that happens you will automatically receive e-mail confirmation message for successful registration with your registration number. Please print this voucher and bring it with you when arriving to the lecture. We hope we’ll be able to welcome you to the lecture!<br><br> |
107 |
|
108 |
Department of Psychology<br> |
109 |
Faculty of Humanities and Social Sciences<br> |
110 |
University of Zagreb |
111 |
|
112 |
| ) |
113 |
; |
114 |
|
115 |
$self->send( $email, |
116 |
"Potvrda / Confirmation - Zimbardo" . ( $seat ? " [no. $seat]" : " [lista cekanja / wating list]" ), |
117 |
$html . <<__EMAIL__ |
118 |
|
119 |
|
120 |
__EMAIL__ |
121 |
); |
122 |
|
123 |
return $html; |
124 |
|
125 |
} else { # not verified |
126 |
|
127 |
my $url = $self->url_for( 'Confirmation/verify_as_markup?token=', $token ); |
128 |
|
129 |
$self->send( $email, |
130 |
'Potvrdite prijavu za Zimbarda / Confirm your registration for Zimbardo', <<__EMAIL__ |
131 |
|
132 |
Svoju prijavu za predavanje potvrdite tako da slijedite ovaj link: |
133 |
Confirm your registration for the lecture by following this link: |
134 |
<br> |
135 |
$url |
136 |
<br><br> |
137 |
Dobit cete poruku s Vasim brojem prijave koja ce sluziti kao ulaznica na predavanje.<br> |
138 |
You will receive the message with your registration number (voucher) that serves as the ticket for the lecture. |
139 |
|
140 |
__EMAIL__ |
141 |
); |
142 |
|
143 |
return qq| |
144 |
<br><br> |
145 |
$name, <br><br> |
146 |
Vasa prijava je zaprimljena, ali <u>nije valjana</u> sve dok ju ne potvrdite pomocu poruke koju smo poslali na <tt>$email</tt> |
147 |
<br><br> |
148 |
Your registration is received but it is <u>not valid</u> until you confirm it! |
149 |
<br><br> |
150 |
<div style="color:red"> |
151 |
Molimo provjerite svoj e-mail i u njemu cete naci link uz pomoc kojeg cete prijavu |
152 |
jednostavno potvrditi.<br><br> |
153 |
Please check you e-mail <tt>$email</tt>. You will receive the message with the link to confirm your registration. |
154 |
|
155 |
</div> |
156 |
|; |
157 |
|
158 |
} |
159 |
|
160 |
} |
161 |
|
162 |
1; |