Skip to content

Commit

Permalink
Merge pull request #118 from swindonmakers/castaway/hotfix_reminder_e…
Browse files Browse the repository at this point in the history
…mails

Do not force recreation of reminder emails
  • Loading branch information
castaway authored Feb 16, 2025
2 parents 6441b64 + 996f25f commit 52b1de5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/AccessSystem/Schema/Result/Communication.pm
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ __PACKAGE__->add_columns(
is_nullable => 1,
},
);
__PACKAGE__->set_primary_key('person_id', 'type');
__PACKAGE__->set_primary_key('person_id', 'created_on');

__PACKAGE__->belongs_to('person', 'AccessSystem::Schema::Result::Person', 'person_id' );

Expand Down
9 changes: 6 additions & 3 deletions lib/AccessSystem/Schema/Result/Person.pm
Original file line number Diff line number Diff line change
Expand Up @@ -534,7 +534,7 @@ sub create_payment {
'Swindon Makerspace membership check',
'reminder_email',
{ paid_date => $paid_date, expires_date => $expires_date },
1);
);
}
return;
}
Expand Down Expand Up @@ -644,8 +644,11 @@ sub create_communication {
my $check_exists = $self->communications_rs->search_rs({
type => $type,
});
if($check_exists->count == 1 && !$force) {
return $check_exists->first;
if($check_exists->count == 1) {
if(!$force) {
return $check_exists->first;
}
$check_exists->delete;
}

# templates in $ENV{CATALYST_HOME}/root/src/emails/<type>/<type>.txt / .html
Expand Down

0 comments on commit 52b1de5

Please sign in to comment.