From 886e6b3de87a016aaa128a7d6492dc52781efdf5 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Sat, 3 Feb 2024 22:31:24 +1100 Subject: [PATCH] Improvements for email handling --- app/Mail/Engine/PaymentEmailEngine.php | 2 +- app/Mail/TemplateEmail.php | 2 +- resources/views/email/template/client.blade.php | 2 +- routes/client.php | 3 --- 4 files changed, 3 insertions(+), 6 deletions(-) diff --git a/app/Mail/Engine/PaymentEmailEngine.php b/app/Mail/Engine/PaymentEmailEngine.php index ade3c995603a..58614d8ea1ef 100644 --- a/app/Mail/Engine/PaymentEmailEngine.php +++ b/app/Mail/Engine/PaymentEmailEngine.php @@ -208,7 +208,7 @@ class PaymentEmailEngine extends BaseEmailEngine $data['$payment.date'] = ['value' => $this->translateDate($this->payment->date, $this->client->date_format(), $this->client->locale()), 'label' => ctrans('texts.payment_date')]; $data['$transaction_reference'] = ['value' => $this->payment->transaction_reference, 'label' => ctrans('texts.transaction_reference')]; $data['$reference'] = ['value' => '', 'label' => ctrans('texts.reference')]; - $data['$public_notes'] = ['value' => $this->payment->public_notes, 'label' => ctrans('texts.notes')]; + $data['$public_notes'] = ['value' => '', 'label' => ctrans('texts.notes')]; $data['$payment1'] = ['value' => $this->helpers->formatCustomFieldValue($this->company->custom_fields, 'payment1', $this->payment->custom_value1, $this->client) ?: ' ', 'label' => $this->helpers->makeCustomField($this->company->custom_fields, 'payment1')]; $data['$payment2'] = ['value' => $this->helpers->formatCustomFieldValue($this->company->custom_fields, 'payment2', $this->payment->custom_value2, $this->client) ?: ' ', 'label' => $this->helpers->makeCustomField($this->company->custom_fields, 'payment2')]; diff --git a/app/Mail/TemplateEmail.php b/app/Mail/TemplateEmail.php index 7ccd29cac206..90352e00b68e 100644 --- a/app/Mail/TemplateEmail.php +++ b/app/Mail/TemplateEmail.php @@ -139,7 +139,7 @@ class TemplateEmail extends Mailable 'whitelabel' => $this->client->user->account->isPaid() ? true : false, 'logo' => $this->company->present()->logo($settings), 'links' => $this->build_email->getAttachmentLinks(), - 'email_preferences' => (Ninja::isHosted() && in_array($settings->email_sending_method, ['default', 'mailgun'])) ? URL::signedRoute('client.email_preferences', ['entity' => $this->invitation->getEntityString(), 'invitation_key' => $this->invitation->key]) : false, + 'email_preferences' => (Ninja::isHosted() && in_array($settings->email_sending_method, ['default', 'mailgun'])) ? $this->company->domain() . URL::signedRoute('client.email_preferences', ['entity' => $this->invitation->getEntityString(), 'invitation_key' => $this->invitation->key], absolute: false) : false, ]); foreach ($this->build_email->getAttachments() as $file) { diff --git a/resources/views/email/template/client.blade.php b/resources/views/email/template/client.blade.php index 1076ab9d32a9..f13a3572b40a 100644 --- a/resources/views/email/template/client.blade.php +++ b/resources/views/email/template/client.blade.php @@ -240,7 +240,7 @@ style="padding-top: 10px;padding-bottom: 10px; background-color: #242424; border: 1px solid #c2c2c2; border-top-color: #242424; border-bottom-color: #242424;">

- {{ ctrans('texts.unsubscribe') }} + {{ ctrans('texts.email_preferences') }}

diff --git a/routes/client.php b/routes/client.php index 3bf5d6798365..0e3fdd729a89 100644 --- a/routes/client.php +++ b/routes/client.php @@ -141,15 +141,12 @@ Route::group(['middleware' => ['invite_db'], 'prefix' => 'client', 'as' => 'clie Route::get('unsubscribe/{entity}/{invitation_key}', [App\Http\Controllers\ClientPortal\InvitationController::class, 'unsubscribe'])->name('unsubscribe'); }); - Route::get('route/{hash}', function ($hash) { return redirect(decrypt($hash)); }); - - Route::get('phantom/{entity}/{invitation_key}', [Phantom::class, 'displayInvitation'])->middleware(['invite_db', 'phantom_secret'])->name('phantom_view'); Route::get('blade/', [Phantom::class, 'blade'])->name('blade');