1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 13:12:50 +01:00

Add manual payment notifications

This commit is contained in:
David Bomba 2023-04-24 09:31:28 +10:00
parent b51eb5e23c
commit 252effabef
2 changed files with 33 additions and 1 deletions

View File

@ -56,8 +56,39 @@ class PaymentNotification implements ShouldQueue
$this->trackRevenue($event);
}
if($payment->is_manual)
/* Manual Payment Notifications */
if($payment->is_manual){
foreach ($payment->company->company_users as $company_user) {
$user = $company_user->user;
$methods = $this->findUserEntityNotificationType(
$payment,
$company_user,
[
'payment_manual',
'payment_manual_all',
'payment_manual_user',
'all_notifications', ]
);
if (($key = array_search('mail', $methods)) !== false) {
unset($methods[$key]);
$nmo = new NinjaMailerObject;
$nmo->mailable = new NinjaMailer((new EntityPaidObject($payment))->build());
$nmo->company = $event->company;
$nmo->settings = $event->company->settings;
$nmo->to_user = $user;
(new NinjaMailerJob($nmo))->handle();
$nmo = null;
}
}
return;
}
/*User notifications*/
foreach ($payment->company->company_users as $company_user) {

View File

@ -5062,6 +5062,7 @@ $LANG = array(
'here' => 'here',
'industry_Restaurant & Catering' => 'Restaurant & Catering',
'show_credits_table' => 'Show Credits Table',
'manual_payment' => 'Payment Manual',
);