diff --git a/app/Jobs/Util/WebhookHandler.php b/app/Jobs/Util/WebhookHandler.php index da2419ea3306..aad1fb2d537a 100644 --- a/app/Jobs/Util/WebhookHandler.php +++ b/app/Jobs/Util/WebhookHandler.php @@ -120,7 +120,7 @@ class WebhookHandler implements ShouldQueue SystemLog::CATEGORY_WEBHOOK, SystemLog::EVENT_WEBHOOK_SUCCESS, SystemLog::TYPE_WEBHOOK_RESPONSE, - $this->company->clients->first(), + $this->resolveClient(), $this->company ); @@ -137,7 +137,7 @@ class WebhookHandler implements ShouldQueue SystemLog::CATEGORY_WEBHOOK, SystemLog::EVENT_WEBHOOK_RESPONSE, SystemLog::TYPE_WEBHOOK_RESPONSE, - $this->company->clients->first(), + $this->resolveClient(), $this->company, ); @@ -145,6 +145,15 @@ class WebhookHandler implements ShouldQueue } + private function resolveClient() + { + if($this->entity->client()->exists()){ + return $this->entity->client; + } + + return $this->company->clients->first(); + } + public function failed($exception) { nlog(print_r($exception->getMessage(), 1)); diff --git a/app/Mail/Engine/PaymentEmailEngine.php b/app/Mail/Engine/PaymentEmailEngine.php index a582822e6bf6..ed36c8ae321f 100644 --- a/app/Mail/Engine/PaymentEmailEngine.php +++ b/app/Mail/Engine/PaymentEmailEngine.php @@ -135,6 +135,7 @@ class PaymentEmailEngine extends BaseEmailEngine { $data = []; + $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')];