diff --git a/app/Http/Controllers/SearchController.php b/app/Http/Controllers/SearchController.php index 6896dbde2213..c34efc2dced4 100644 --- a/app/Http/Controllers/SearchController.php +++ b/app/Http/Controllers/SearchController.php @@ -59,7 +59,7 @@ class SearchController extends Controller 'name' => $client->present()->name(), 'type' => '/client', 'id' => $client->hashed_id, - 'path' => "/clients/{$client->hashed_id}/edit" + 'path' => "/clients/{$client->hashed_id}" ]; $client->contacts->each(function ($contact) { diff --git a/app/Jobs/Payment/EmailPayment.php b/app/Jobs/Payment/EmailPayment.php index 275a9579fa4c..2054d18ec0ee 100644 --- a/app/Jobs/Payment/EmailPayment.php +++ b/app/Jobs/Payment/EmailPayment.php @@ -59,6 +59,7 @@ class EmailPayment implements ShouldQueue public function handle() { if ($this->company->is_disabled || (!$this->contact->email ?? false)) { + nlog("company disabled - or - contact email not found"); return; } diff --git a/app/Listeners/Invoice/InvoiceEmailFailedActivity.php b/app/Listeners/Invoice/InvoiceEmailFailedActivity.php index e8d21797afda..d2df49622fae 100644 --- a/app/Listeners/Invoice/InvoiceEmailFailedActivity.php +++ b/app/Listeners/Invoice/InvoiceEmailFailedActivity.php @@ -58,7 +58,8 @@ class InvoiceEmailFailedActivity implements ShouldQueue $fields->client_contact_id = $event->invitation->client_contact_id; $fields->company_id = $event->invitation->invoice->company_id; $fields->activity_type_id = Activity::EMAIL_INVOICE_FAILED; - + $fields->notes = $event->message ?? ''; + $this->activity_repo->save($fields, $event->invitation->invoice, $event->event_vars); } } diff --git a/app/Listeners/Invoice/InvoiceFailedEmailNotification.php b/app/Listeners/Invoice/InvoiceFailedEmailNotification.php index 136dcc71ed35..f2d58edbe872 100644 --- a/app/Listeners/Invoice/InvoiceFailedEmailNotification.php +++ b/app/Listeners/Invoice/InvoiceFailedEmailNotification.php @@ -11,10 +11,11 @@ namespace App\Listeners\Invoice; +use App\Libraries\MultiDB; use App\Jobs\Mail\NinjaMailer; use App\Jobs\Mail\NinjaMailerJob; use App\Jobs\Mail\NinjaMailerObject; -use App\Libraries\MultiDB; +use Illuminate\Support\Facades\Cache; use App\Mail\Admin\EntityFailedSendObject; use App\Utils\Traits\Notifications\UserNotifies; @@ -36,7 +37,8 @@ class InvoiceFailedEmailNotification { MultiDB::setDb($event->company->db); - $first_notification_sent = true; + if(Cache::has("invoice_failed_email_notification_{$event->invitation->key}")) + return; $invoice = $event->invitation->invoice; @@ -58,8 +60,9 @@ class InvoiceFailedEmailNotification $nmo = null; - $first_notification_sent = false; } } + + Cache::put("invoice_failed_email_notification_{$event->invitation->key}", true, 60 * 60); } }