diff --git a/app/Http/Controllers/PaymentController.php b/app/Http/Controllers/PaymentController.php index 951b2a3c77e1..442a76319706 100644 --- a/app/Http/Controllers/PaymentController.php +++ b/app/Http/Controllers/PaymentController.php @@ -520,7 +520,7 @@ class PaymentController extends BaseController if($action == 'template' && $user->can('view', $payments->first())) { $hash_or_response = request()->boolean('send_email') ? 'email sent' : \Illuminate\Support\Str::uuid(); - nlog($payments->pluck('hashed_id')->toArray()); + TemplateAction::dispatch( $payments->pluck('hashed_id')->toArray(), $request->template_id, diff --git a/app/Jobs/Payment/EmailPayment.php b/app/Jobs/Payment/EmailPayment.php index 316045871118..275a9579fa4c 100644 --- a/app/Jobs/Payment/EmailPayment.php +++ b/app/Jobs/Payment/EmailPayment.php @@ -58,7 +58,7 @@ class EmailPayment implements ShouldQueue */ public function handle() { - if ($this->company->is_disabled || ($this->contact->email ?? false)) { + if ($this->company->is_disabled || (!$this->contact->email ?? false)) { return; } diff --git a/app/Services/Payment/PaymentService.php b/app/Services/Payment/PaymentService.php index 363d1eda1439..ed4e165a3d84 100644 --- a/app/Services/Payment/PaymentService.php +++ b/app/Services/Payment/PaymentService.php @@ -21,11 +21,8 @@ class PaymentService { use MakesHash; - private $payment; - - public function __construct($payment) + public function __construct(public Payment $payment) { - $this->payment = $payment; } public function manualPayment($invoice): ?Payment