mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Payment emails
This commit is contained in:
parent
fcef2c72b3
commit
2e8cb84570
@ -39,6 +39,7 @@ class EmailPayment extends BaseMailerJob implements ShouldQueue
|
||||
private $company;
|
||||
|
||||
public $settings;
|
||||
|
||||
/**
|
||||
* Create a new job instance.
|
||||
*
|
||||
|
@ -103,6 +103,7 @@ class PaymentEmailEngine extends BaseEmailEngine
|
||||
$data['$from'] = ['value' => '', 'label' => ctrans('texts.from')];
|
||||
$data['$to'] = ['value' => '', 'label' => ctrans('texts.to')];
|
||||
$data['$number'] = ['value' => $this->payment->number ?: ' ', 'label' => ctrans('texts.payment_number')];
|
||||
$data['$payment.number'] = &$data['$number'];
|
||||
$data['$entity'] = ['value' => '', 'label' => ctrans('texts.payment')];
|
||||
$data['$payment.amount'] = ['value' => Number::formatMoney($this->payment->amount, $this->client) ?: ' ', 'label' => ctrans('texts.amount')];
|
||||
$data['$amount'] = &$data['$payment.amount'];
|
||||
|
@ -14,6 +14,7 @@ namespace App\Services\Invoice;
|
||||
use App\Events\Invoice\InvoiceWasPaid;
|
||||
use App\Events\Payment\PaymentWasCreated;
|
||||
use App\Factory\PaymentFactory;
|
||||
use App\Jobs\Payment\EmailPayment;
|
||||
use App\Models\Invoice;
|
||||
use App\Models\Payment;
|
||||
use App\Services\AbstractService;
|
||||
@ -74,6 +75,8 @@ class MarkPaid extends AbstractService
|
||||
->applyNumber()
|
||||
->save();
|
||||
|
||||
EmailPayment::dispatch($payment, $payment->company, $payment->client->primary_contact()->first());
|
||||
|
||||
/* Update Invoice balance */
|
||||
event(new PaymentWasCreated($payment, $payment->company, Ninja::eventVars()));
|
||||
event(new InvoiceWasPaid($this->invoice, $payment->company, Ninja::eventVars()));
|
||||
|
Loading…
x
Reference in New Issue
Block a user