diff --git a/app/Jobs/Payment/EmailRefundPayment.php b/app/Jobs/Payment/EmailRefundPayment.php index 6096061f6e..8539cceb55 100644 --- a/app/Jobs/Payment/EmailRefundPayment.php +++ b/app/Jobs/Payment/EmailRefundPayment.php @@ -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

$invoices'; + $template_data['subject'] = ctrans('texts.refunded_payment'); $email_builder = (new PaymentEmailEngine($this->payment, $this->contact, $template_data))->build(); diff --git a/app/Services/Payment/RefundPayment.php b/app/Services/Payment/RefundPayment.php index c63ebc3834..cdf86f2d0f 100644 --- a/app/Services/Payment/RefundPayment.php +++ b/app/Services/Payment/RefundPayment.php @@ -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 = [