Skip to content

Commit

Permalink
Update User.pm
Browse files Browse the repository at this point in the history
  • Loading branch information
droberts-ctrlo authored Dec 18, 2024
1 parent 9c21e58 commit 8147810
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions lib/GADS/Schema/Result/User.pm
Original file line number Diff line number Diff line change
Expand Up @@ -1014,12 +1014,14 @@ sub permissions
}
}

sub _map_fields {
my ($self, $text) = @_;
sub _map_fields
{ my ($self, $text) = @_;
my @fields = ('firstname', 'surname', 'email', 'title', 'organisation', 'department', 'team');

if($text) {
foreach my $field (@fields) {
if($text)
{
foreach my $field (@fields)
{
my $value = $self->$field || '';
$text =~ s/\{$field\}/$value/g;
}
Expand All @@ -1037,8 +1039,10 @@ sub retire
my $site = $schema->resultset('Site')->next;

# Properly delete if account request - no record needed
if ($self->account_request) {
if($options{send_reject_email}) {
if ($self->account_request)
{
if ($options{send_reject_email})
{
my $email_body = $options{email_reject_text} || $site->email_reject_text || "Your account request has been rejected";
$email_body = $self->_map_fields($email_body);

Expand Down

0 comments on commit 8147810

Please sign in to comment.