From e6e190240fcebe94f5b30f81b5a8104c4aa27047 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Wed, 7 Jun 2023 17:15:04 +1000 Subject: [PATCH] Fixes for admin urls --- app/Jobs/Quote/QuoteCheckExpired.php | 3 ++- app/Listeners/Quote/QuoteApprovedNotification.php | 2 +- app/Mail/Admin/QuoteExpiredObject.php | 2 +- app/Models/PurchaseOrderInvitation.php | 2 +- app/PaymentDrivers/StripePaymentDriver.php | 2 +- 5 files changed, 6 insertions(+), 5 deletions(-) diff --git a/app/Jobs/Quote/QuoteCheckExpired.php b/app/Jobs/Quote/QuoteCheckExpired.php index d1880458b779..7cbefdb3a60f 100644 --- a/app/Jobs/Quote/QuoteCheckExpired.php +++ b/app/Jobs/Quote/QuoteCheckExpired.php @@ -95,7 +95,6 @@ class QuoteCheckExpired implements ShouldQueue private function queueExpiredQuoteNotification(Quote $quote) { $nmo = new NinjaMailerObject; - $nmo->mailable = new NinjaMailer((new QuoteExpiredObject($quote, $quote->company))->build()); $nmo->company = $quote->company; $nmo->settings = $quote->company->settings; @@ -107,6 +106,8 @@ class QuoteCheckExpired implements ShouldQueue if (! $user) { continue; } + + $nmo->mailable = new NinjaMailer((new QuoteExpiredObject($quote, $quote->company, $company_user->portalType()))->build()); /* Returns an array of notification methods */ $methods = $this->findUserNotificationTypes($quote->invitations()->first(), $company_user, 'quote', ['all_notifications', 'quote_expired', 'quote_expired_all', 'quote_expired_user']); diff --git a/app/Listeners/Quote/QuoteApprovedNotification.php b/app/Listeners/Quote/QuoteApprovedNotification.php index c6c0c61c8aa5..7b47cdbe58f0 100644 --- a/app/Listeners/Quote/QuoteApprovedNotification.php +++ b/app/Listeners/Quote/QuoteApprovedNotification.php @@ -61,7 +61,7 @@ class QuoteApprovedNotification implements ShouldQueue unset($methods[$key]); $nmo = new NinjaMailerObject; - $nmo->mailable = new NinjaMailer((new QuoteApprovedObject($quote, $event->company))->build()); + $nmo->mailable = new NinjaMailer((new QuoteApprovedObject($quote, $event->company, $company_user->portalType()))->build()); $nmo->company = $quote->company; $nmo->settings = $quote->company->settings; diff --git a/app/Mail/Admin/QuoteExpiredObject.php b/app/Mail/Admin/QuoteExpiredObject.php index f3d63050db94..700c5e33eb6b 100644 --- a/app/Mail/Admin/QuoteExpiredObject.php +++ b/app/Mail/Admin/QuoteExpiredObject.php @@ -84,7 +84,7 @@ class QuoteExpiredObject ] ), 'url' => $this->quote->invitations->first()->getAdminLink($this->use_react_url), - 'button' => ctrans('texts.view_quote'), + 'button' => $this->use_react_url ? ctrans('texts.view_quote') : ctrans('texts.login'), 'signature' => $settings->email_signature, 'logo' => $this->company->present()->logo(), 'settings' => $settings, diff --git a/app/Models/PurchaseOrderInvitation.php b/app/Models/PurchaseOrderInvitation.php index 86122fd794c0..2e3b32828230 100644 --- a/app/Models/PurchaseOrderInvitation.php +++ b/app/Models/PurchaseOrderInvitation.php @@ -203,7 +203,7 @@ class PurchaseOrderInvitation extends BaseModel { $entity_type = Str::snake(class_basename($this->entityType())); - return config('ninja.app_url')."/#/{$entity_type}/{$this->{$entity_type}->hashed_id}/edit"; + return config('ninja.react_url')."/{$entity_type}s/{$this->{$entity_type}->hashed_id}/edit"; } } diff --git a/app/PaymentDrivers/StripePaymentDriver.php b/app/PaymentDrivers/StripePaymentDriver.php index f575378da66b..70c2f009730a 100644 --- a/app/PaymentDrivers/StripePaymentDriver.php +++ b/app/PaymentDrivers/StripePaymentDriver.php @@ -664,7 +664,7 @@ class StripePaymentDriver extends BaseDriver } public function processWebhookRequest(PaymentWebhookRequest $request) - {nlog($request->all()); + { if ($request->type === 'customer.source.updated') { $ach = new ACH($this); $ach->updateBankAccount($request->all());