Made it work
This commit is contained in:
parent
311402e1b8
commit
cd627f811d
@ -77,9 +77,9 @@ class Cron {
|
||||
$notify_loans[] = $loan;
|
||||
}
|
||||
}
|
||||
$this->send_receipt($user, $loans);
|
||||
$this->send_receipt($user, $notify_loans);
|
||||
$delete = prepare('delete from `pending_receipt`
|
||||
where `user = ? and `send_time` < ?');
|
||||
where `user` = ? and `send_time` < ?');
|
||||
bind($delete, 'ii', $user->get_id(), $this->now->getTimestamp());
|
||||
execute($delete);
|
||||
}
|
||||
@ -87,6 +87,9 @@ class Cron {
|
||||
}
|
||||
|
||||
private function send_receipt($user, $loans) {
|
||||
$uid = $user->get_name();
|
||||
$name = $this->ldap->get_firstname($uid);
|
||||
|
||||
$count = count($loans);
|
||||
if($count > 1) {
|
||||
$new_sv = "nya lån";
|
||||
@ -292,7 +295,7 @@ EOF;
|
||||
$message,
|
||||
'From: '.$this->sender);
|
||||
} catch(Exception $e) {
|
||||
error_log($e->message);
|
||||
error_log($e->getMessage());
|
||||
mb_send_mail($this->error,
|
||||
"Kunde inte skicka mail",
|
||||
"Mail kunde inte skickas till ".$uid);
|
||||
|
Loading…
x
Reference in New Issue
Block a user