From 81478108ce06719fd3e79b98ad0e08c083c0c1fd Mon Sep 17 00:00:00 2001 From: Dave Roberts <145559566+droberts-ctrlo@users.noreply.github.com> Date: Wed, 18 Dec 2024 16:39:11 +0000 Subject: [PATCH] Update User.pm --- lib/GADS/Schema/Result/User.pm | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/lib/GADS/Schema/Result/User.pm b/lib/GADS/Schema/Result/User.pm index ce29650dc..53377e10e 100644 --- a/lib/GADS/Schema/Result/User.pm +++ b/lib/GADS/Schema/Result/User.pm @@ -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; } @@ -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);