unsubscribe fixes
This commit is contained in:
@@ -58,23 +58,8 @@ class SendEmail implements ShouldQueue
|
||||
|
||||
// Add unsubscribe link if mailable supports it
|
||||
if (method_exists($this->mailable, 'withUnsubscribeLink')) {
|
||||
Log::info('SendEmail: Adding unsubscribe link', [
|
||||
'job_id' => $this->job?->getJobId(),
|
||||
'recipient' => $this->to,
|
||||
'mailable' => get_class($this->mailable),
|
||||
'sentEmailId' => $sentEmail->id,
|
||||
]);
|
||||
|
||||
|
||||
$unsubscribeLink = route('unsubscribe', ['email' => $sentEmail->id]);
|
||||
$this->mailable->withUnsubscribeLink($unsubscribeLink);
|
||||
} else {
|
||||
Log::info('SendEmail: No unsubscribe link', [
|
||||
'job_id' => $this->job?->getJobId(),
|
||||
'recipient' => $this->to,
|
||||
'mailable' => get_class($this->mailable),
|
||||
'sentEmailId' => $sentEmail->id,
|
||||
]);
|
||||
}
|
||||
|
||||
Mail::to($this->to)->send($this->mailable);
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
<p>This email was sent to <a href="mailto:{{ $email }}">{{ $email }}</a><br />
|
||||
<a href="{{ route('index') }}">{{ config('app.name') }}</a> | 63 Dalton Street | Westcourt, QLD 4870 Australia<br />
|
||||
© {{ date('Y') }} {{ config('app.name') }}. {{ __('All rights reserved.') }}<br />
|
||||
<a href="{{ route('privacy') }}">Privacy Policy</a> | <a href="{{ route('terms-conditions') }}">Terms & Conditions</a> @isset($unsubscribe) | <a href="{{ $unsubscribe }}">Unsubscribe</a>@endisset
|
||||
<a href="{{ route('privacy') }}">Privacy Policy</a> | <a href="{{ route('terms-conditions') }}">Terms & Conditions</a> @isset($unsubscribeLink) | <a href="{{ $unsubscribeLink }}">Unsubscribe</a>@endisset
|
||||
</p>
|
||||
</x-mail::footer>
|
||||
</x-slot:footer>
|
||||
|
||||
@@ -18,7 +18,7 @@ This email was sent to {{ $email }}
|
||||
STEMMechanics | 63 Dalton Street | Westcourt, QLD 4870 Australia
|
||||
© {{ date('Y') }} {{ config('app.name') }}. {{ __('All rights reserved.') }}
|
||||
|
||||
@isset($unsubscribe) Unsubscribe: {{ $unsubscribe }}@endisset
|
||||
@isset($unsubscribeLink) Unsubscribe: {{ $unsubscribeLink }}@endisset
|
||||
</x-mail::footer>
|
||||
</x-slot:footer>
|
||||
</x-mail::layout>
|
||||
|
||||
Reference in New Issue
Block a user