Skip to content

Commit 6404b3a

Browse files
committed
Actually send fees email (now), msg display on verify
1 parent 122bf3b commit 6404b3a

2 files changed

Lines changed: 9 additions & 1 deletion

File tree

lib/AccessSystem/API/Controller/Root.pm

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff 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,

lib/AccessSystem/Schema/ResultSet/Person.pm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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
}

0 commit comments

Comments
 (0)