|
Lines 131-136
sub SendPasswordRecoveryEmail {
Link Here
|
| 131 |
my $opacbase = C4::Context->preference('OPACBaseURL') || ''; |
131 |
my $opacbase = C4::Context->preference('OPACBaseURL') || ''; |
| 132 |
my $uuidLink = $opacbase . "/cgi-bin/koha/opac-password-recovery.pl?uniqueKey=$uuid_str"; |
132 |
my $uuidLink = $opacbase . "/cgi-bin/koha/opac-password-recovery.pl?uniqueKey=$uuid_str"; |
| 133 |
|
133 |
|
|
|
134 |
# create a sanitised borrower hash |
| 135 |
my $user = $borrower->unblessed; |
| 136 |
my $library = $borrower->library; |
| 137 |
$user->{branchname} = $library ? $library->branchname : ''; |
| 138 |
delete $user->{password}; |
| 139 |
|
| 134 |
# prepare the email |
140 |
# prepare the email |
| 135 |
my $letter = C4::Letters::GetPreparedLetter( |
141 |
my $letter = C4::Letters::GetPreparedLetter( |
| 136 |
module => 'members', |
142 |
module => 'members', |
|
Lines 138-147
sub SendPasswordRecoveryEmail {
Link Here
|
| 138 |
branchcode => $borrower->branchcode, |
144 |
branchcode => $borrower->branchcode, |
| 139 |
lang => $borrower->lang, |
145 |
lang => $borrower->lang, |
| 140 |
substitute => { passwordreseturl => $uuidLink, user => $borrower->userid }, |
146 |
substitute => { passwordreseturl => $uuidLink, user => $borrower->userid }, |
|
|
147 |
tables => { branches => $borrower->branchcode }, |
| 148 |
objects => { borrower => $user }, |
| 141 |
); |
149 |
); |
| 142 |
|
150 |
|
| 143 |
# define from emails |
151 |
# define from emails |
| 144 |
my $library = $borrower->library; |
|
|
| 145 |
my $kohaEmail = $library->from_email_address; # send from patron's branch or Koha Admin |
152 |
my $kohaEmail = $library->from_email_address; # send from patron's branch or Koha Admin |
| 146 |
|
153 |
|
| 147 |
my $message_id = C4::Letters::EnqueueLetter( |
154 |
my $message_id = C4::Letters::EnqueueLetter( |