diff --git a/app/Http/Controllers/Api/ChunkedUploadController.php b/app/Http/Controllers/Api/ChunkedUploadController.php index edc90c9..68b47db 100644 --- a/app/Http/Controllers/Api/ChunkedUploadController.php +++ b/app/Http/Controllers/Api/ChunkedUploadController.php @@ -139,7 +139,7 @@ class ChunkedUploadController extends Controller 'data' => [ 'id' => $transfer->id, 'title' => $transfer->title, - 'public_url' => $transfer->qrCode?->publicUrl(), + 'public_url' => $transfer->qrCode?->shareUrl(), 'paid_until' => $transfer->paid_until?->toIso8601String(), 'expires_at' => $transfer->paid_until?->toIso8601String(), 'files' => $transfer->files->map(fn ($file) => [ diff --git a/app/Http/Controllers/Api/TransferController.php b/app/Http/Controllers/Api/TransferController.php index 31d782e..952ed93 100644 --- a/app/Http/Controllers/Api/TransferController.php +++ b/app/Http/Controllers/Api/TransferController.php @@ -68,7 +68,7 @@ class TransferController extends Controller 'data' => [ 'id' => $transfer->id, 'title' => $transfer->title, - 'public_url' => $transfer->qrCode?->publicUrl(), + 'public_url' => $transfer->qrCode?->shareUrl(), 'paid_until' => $transfer->paid_until?->toIso8601String(), 'expires_at' => $transfer->paid_until?->toIso8601String(), 'files' => $transfer->files->map(fn ($file) => [ diff --git a/app/Models/QrCode.php b/app/Models/QrCode.php index 14e628f..a4a8676 100644 --- a/app/Models/QrCode.php +++ b/app/Models/QrCode.php @@ -86,6 +86,14 @@ class QrCode extends Model return self::publicBaseUrl() . '/q/' . $this->short_code; } + /** Direct link for emails and share UI โ€” always on the Transfer app host. */ + public function shareUrl(): string + { + $base = rtrim((string) config('app.url'), '/'); + + return $base . '/q/' . $this->short_code; + } + /** * Base URL for public QR links. Always the short platform domain * (ladill.com) โ€” never the signed-in account/product host โ€” so printed diff --git a/app/Notifications/TransferRecipientNotification.php b/app/Notifications/TransferRecipientNotification.php index 9450a19..720ab68 100644 --- a/app/Notifications/TransferRecipientNotification.php +++ b/app/Notifications/TransferRecipientNotification.php @@ -24,7 +24,7 @@ class TransferRecipientNotification extends Notification public function toMail(mixed $notifiable): MailMessage { $transfer = $this->transfer->loadMissing(['files', 'qrCode', 'user']); - $publicUrl = $transfer->qrCode?->publicUrl() ?? ''; + $publicUrl = $transfer->qrCode?->shareUrl() ?? ''; return (new MailMessage()) ->subject($this->subjectLine()) diff --git a/public/images/logo/ladilltransfer-logo-email.png b/public/images/logo/ladilltransfer-logo-email.png new file mode 100644 index 0000000..131a496 Binary files /dev/null and b/public/images/logo/ladilltransfer-logo-email.png differ diff --git a/resources/views/mail/notifications/layout.blade.php b/resources/views/mail/notifications/layout.blade.php index e844145..c97b8f0 100644 --- a/resources/views/mail/notifications/layout.blade.php +++ b/resources/views/mail/notifications/layout.blade.php @@ -367,7 +367,11 @@
{{-- Header with Logo --}}
- + @hasSection('email-header') + @yield('email-header') + @else + + @endif
@hasSection('icon-header') diff --git a/resources/views/mail/notifications/transfer-recipient.blade.php b/resources/views/mail/notifications/transfer-recipient.blade.php index 559b9bc..e2a9c89 100644 --- a/resources/views/mail/notifications/transfer-recipient.blade.php +++ b/resources/views/mail/notifications/transfer-recipient.blade.php @@ -1,25 +1,34 @@ @extends('mail.notifications.layout') +@section('email-header') + +@endsection + @section('content') @php $fileCount = $transfer->files->count(); $availableUntil = $transfer->isInGracePeriod() ? $transfer->grace_ends_at : $transfer->paid_until; - @endphp + $fmtBytes = function (int $bytes) { + if ($bytes >= 1048576) { + return number_format($bytes / 1048576, 1).' MB'; + } + if ($bytes >= 1024) { + return number_format($bytes / 1024, 0).' KB'; + } -
-

๐Ÿ“ File transfer

-

{{ $transfer->title }}

-
+ return $bytes.' B'; + }; + @endphp @if($milestone === 'created')

You have files to download

@if($senderName) - {{ $senderName }} shared {{ $fileCount === 1 ? 'a file' : $fileCount.' files' }} with you via Ladill Transfer. + {{ $senderName }} shared {{ $fileCount === 1 ? 'a file' : $fileCount.' files' }} with you through Ladill Transfer. @else - Someone shared {{ $fileCount === 1 ? 'a file' : $fileCount.' files' }} with you via Ladill Transfer. + Someone shared {{ $fileCount === 1 ? 'a file' : $fileCount.' files' }} with you through Ladill Transfer. @endif

@elseif($milestone === 'grace') @@ -47,34 +56,54 @@

@endif +
+ + + + @foreach($transfer->files as $file) + + @endforeach +
+ @if($transfer->message) -

+

+ Message from sender {{ $transfer->message }}

@endif @if($transfer->isPasswordProtected()) -

- This transfer is password protected. The sender will need to share the password with you separately. +

+ This transfer is password protected. The sender will share the password with you separately.

@endif - +
-
-

- Or open this link: {{ $publicUrl }} +

+ Or copy this link into your browser:
+ {{ $publicUrl }}

@if($availableUntil && $milestone !== 'grace') -

+

Available until {{ $availableUntil->format('F j, Y') }}.

@endif