File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -286,11 +286,19 @@ sub verify: Chained('base') :PathPart('verify') :Args(0) {
286286 my $result = $c -> model(' AccessDB::Person' )-> allowed_to_thing
287287 ($c -> req-> params-> {token }, $c -> req-> params-> {thing });
288288 if ($result && !$result -> {error }) {
289+ if ($result -> {beep }) {
290+ # Send email now (else next automated one)
291+ my $comm = $result -> {person }-> communications_rs-> find({type => ' membership_fees_change' });
292+ if ($comm ) {
293+ $self -> emailer-> send ($comm );
294+ }
295+ }
289296 $c -> stash(
290297 json => {
291298 person => { name => $result -> {person }-> name },
292299 inductor => $result -> {person }-> allowed-> first-> is_admin,
293300 access => 1,
301+ message => $result -> {message } || ' ' ,
294302 beep => $result -> {beep } || 0,
295303 cache => $result -> {person }-> tier-> restrictions-> {' times' } ? 0 : 1,
296304 colour => $result -> {person }-> door_colour_to_code || 0x01,
Original file line number Diff line number Diff line change @@ -164,7 +164,7 @@ sub allowed_to_thing {
164164 return {
165165 person => $person ,
166166 beep => $beep ,
167- message => ' Fees have changed. Check email.' ,
167+ message => ' Fees have changed. Check email.' ,
168168 thing => $person -> allowed-> first-> tool,
169169 };
170170 }
You can’t perform that action at this time.
0 commit comments