1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-09-20 16:31:33 +02:00

Refund payment receipts

This commit is contained in:
David Bomba 2022-03-14 14:39:44 +11:00
parent c56a9688e8
commit c1bf578658
2 changed files with 7 additions and 3 deletions

View File

@ -83,8 +83,8 @@ class EmailRefundPayment implements ShouldQueue
App::setLocale($this->contact->preferredLocale());
$t->replace(Ninja::transformTranslations($this->settings));
$template_data['body'] = '';
$template_data['subject'] = '';
$template_data['body'] = ctrans('texts.refunded_payment') . ' $amount <br><br>$invoices';
$template_data['subject'] = ctrans('texts.refunded_payment');
$email_builder = (new PaymentEmailEngine($this->payment, $this->contact, $template_data))->build();

View File

@ -15,6 +15,7 @@ use App\Exceptions\PaymentRefundFailed;
use App\Factory\CreditFactory;
use App\Factory\InvoiceItemFactory;
use App\Jobs\Ninja\TransactionLog;
use App\Jobs\Payment\EmailRefundPayment;
use App\Models\Activity;
use App\Models\Credit;
use App\Models\Invoice;
@ -66,7 +67,10 @@ class RefundPayment
if(array_key_exists('email_receipt', $this->refund_data) && $this->refund_data['email_receipt'] == 'true'){
// $this->payment->service()->sendEmail();
$contact = $this->payment->client->contacts()->whereNotNull('email')->first();
EmailRefundPayment::dispatch($this->payment, $this->payment->company, $contact);
}
$transaction = [