order emails theming, sold out product card, contact page hcaptcha

This commit is contained in:
elvira
2026-09-25 17:44:42 +03:00
parent 3347febb3c
commit e2d7bbb043
21 changed files with 445 additions and 39 deletions
@@ -1,3 +1,26 @@
<p>Hi,</p>
{{-- Core passes only the order reference here (and the amount for payment emails). Greek on purpose: sent from the queue in the app default locale. --}}
@extends('emails.layout')
<p>Payment of <strong>{{ $amount }}</strong> for your order <strong>{{ $reference }}</strong> has been captured.</p>
@section('title', "Λάβαμε την πληρωμή σου")
@section('preheader', "Λάβαμε την πληρωμή {$amount} για την παραγγελία #{$reference}.")
@section('content')
<h1 style="margin:0 0 16px;font-family:'Manrope',Arial,Helvetica,sans-serif;font-size:22px;line-height:1.3;font-weight:700;color:#000000;">
Λάβαμε την πληρωμή σου
</h1>
<p style="margin:0 0 32px;">Λάβαμε την πληρωμή σου <strong>{{ $amount }}</strong> για την παραγγελία <strong>#{{ $reference }}</strong>.</p>
@include('emails.partials.button', [
'url' => route('account.orders', ['locale' => 'el']),
'label' => 'Οι παραγγελίες μου',
])
@endsection
@section('footer')
<p style="margin:0;">
Έχεις ερώτηση για την παραγγελία σου;
<a href="{{ route('contact', ['locale' => 'el']) }}" style="color:#7a7a7a;text-decoration:underline;">Επικοινώνησε μαζί μας</a>.
</p>
@endsection
@@ -1,3 +1,26 @@
<p>Hi,</p>
{{-- Core passes only the order reference here (and the amount for payment emails). Greek on purpose: sent from the queue in the app default locale. --}}
@extends('emails.layout')
<p>Your order <strong>{{ $reference }}</strong> is complete. Thanks for shopping with us!</p>
@section('title', "Η παραγγελία σου ολοκληρώθηκε")
@section('preheader', "Η παραγγελία σου #{$reference} ολοκληρώθηκε.")
@section('content')
<h1 style="margin:0 0 16px;font-family:'Manrope',Arial,Helvetica,sans-serif;font-size:22px;line-height:1.3;font-weight:700;color:#000000;">
Η παραγγελία σου ολοκληρώθηκε
</h1>
<p style="margin:0 0 32px;">Η παραγγελία σου <strong>#{{ $reference }}</strong> ολοκληρώθηκε. Ευχαριστούμε που ψώνισες από εμάς!</p>
@include('emails.partials.button', [
'url' => route('account.orders', ['locale' => 'el']),
'label' => 'Οι παραγγελίες μου',
])
@endsection
@section('footer')
<p style="margin:0;">
Έχεις ερώτηση για την παραγγελία σου;
<a href="{{ route('contact', ['locale' => 'el']) }}" style="color:#7a7a7a;text-decoration:underline;">Επικοινώνησε μαζί μας</a>.
</p>
@endsection
@@ -1,3 +1,26 @@
<p>Hi,</p>
{{-- Core passes only the order reference here (and the amount for payment emails). Greek on purpose: sent from the queue in the app default locale. --}}
@extends('emails.layout')
<p>Good news — your order <strong>{{ $reference }}</strong> has been delivered.</p>
@section('title', "Η παραγγελία σου παραδόθηκε")
@section('preheader', "Η παραγγελία σου #{$reference} παραδόθηκε.")
@section('content')
<h1 style="margin:0 0 16px;font-family:'Manrope',Arial,Helvetica,sans-serif;font-size:22px;line-height:1.3;font-weight:700;color:#000000;">
Η παραγγελία σου παραδόθηκε
</h1>
<p style="margin:0 0 32px;">Η παραγγελία σου <strong>#{{ $reference }}</strong> παραδόθηκε. Ελπίζουμε να σου αρέσει!</p>
@include('emails.partials.button', [
'url' => route('account.orders', ['locale' => 'el']),
'label' => 'Οι παραγγελίες μου',
])
@endsection
@section('footer')
<p style="margin:0;">
Έχεις ερώτηση για την παραγγελία σου;
<a href="{{ route('contact', ['locale' => 'el']) }}" style="color:#7a7a7a;text-decoration:underline;">Επικοινώνησε μαζί μας</a>.
</p>
@endsection
@@ -1,3 +1,26 @@
<p>Hi,</p>
{{-- Core passes only the order reference here (and the amount for payment emails). Greek on purpose: sent from the queue in the app default locale. --}}
@extends('emails.layout')
<p>Your order <strong>{{ $reference }}</strong> is on its way.</p>
@section('title', "Η παραγγελία σου στάλθηκε")
@section('preheader', "Η παραγγελία σου #{$reference} είναι καθ’ οδόν.")
@section('content')
<h1 style="margin:0 0 16px;font-family:'Manrope',Arial,Helvetica,sans-serif;font-size:22px;line-height:1.3;font-weight:700;color:#000000;">
Η παραγγελία σου στάλθηκε
</h1>
<p style="margin:0 0 32px;">Η παραγγελία σου <strong>#{{ $reference }}</strong> είναι καθ’ οδόν. Θα τη λάβεις σύντομα.</p>
@include('emails.partials.button', [
'url' => route('account.orders', ['locale' => 'el']),
'label' => 'Οι παραγγελίες μου',
])
@endsection
@section('footer')
<p style="margin:0;">
Έχεις ερώτηση για την παραγγελία σου;
<a href="{{ route('contact', ['locale' => 'el']) }}" style="color:#7a7a7a;text-decoration:underline;">Επικοινώνησε μαζί μας</a>.
</p>
@endsection
@@ -1,3 +1,26 @@
<p>Hi,</p>
{{-- Core passes only the order reference here (and the amount for payment emails). Greek on purpose: sent from the queue in the app default locale. --}}
@extends('emails.layout')
<p>Your order <strong>{{ $reference }}</strong> is ready for pickup in store.</p>
@section('title', "Η παραγγελία σου είναι έτοιμη για παραλαβή")
@section('preheader', "Η παραγγελία σου #{$reference} σε περιμένει στο κατάστημα.")
@section('content')
<h1 style="margin:0 0 16px;font-family:'Manrope',Arial,Helvetica,sans-serif;font-size:22px;line-height:1.3;font-weight:700;color:#000000;">
Η παραγγελία σου είναι έτοιμη για παραλαβή
</h1>
<p style="margin:0 0 32px;">Η παραγγελία σου <strong>#{{ $reference }}</strong> είναι έτοιμη και σε περιμένει στο κατάστημα.</p>
@include('emails.partials.button', [
'url' => route('account.orders', ['locale' => 'el']),
'label' => 'Οι παραγγελίες μου',
])
@endsection
@section('footer')
<p style="margin:0;">
Έχεις ερώτηση για την παραγγελία σου;
<a href="{{ route('contact', ['locale' => 'el']) }}" style="color:#7a7a7a;text-decoration:underline;">Επικοινώνησε μαζί μας</a>.
</p>
@endsection
@@ -1,19 +1,175 @@
<p>Hi,</p>
{{--
Order confirmation (boboko-core's OrderPlacedNotification).
<p>Thanks for your order! Your order <strong>{{ $reference }}</strong> is confirmed.</p>
Core only passes $reference, $total and $lines, so the order itself is
reached through a line (every OrderLine belongs to it). Interim until core
passes the Order to this view.
<ul>
@foreach ($lines as $line)
<li>
{{ $line->quantity }} &times; {{ $line->description }} — {{ $line->total?->formatted }}
{{-- Text answers only — photo answers are deliberately left out of emails. --}}
@foreach ($line->meta['custom_fields'] ?? [] as $field)
@if ($field['type'] !== 'file')
<br>{{ $field['label'] }}: {!! nl2br(e($field['value'])) !!}
@endif
@endforeach
</li>
@endforeach
</ul>
Sent from the queue with no locale of its own, so it always renders in the
app default (Greek). Copy is Greek on purpose, like the other core emails.
--}}
@extends('emails.layout')
<p>Total: <strong>{{ $total }}</strong></p>
@php
$order = $lines->first()->order;
$productLines = $lines->where('type', '!=', 'shipping');
$shippingLine = $lines->firstWhere('type', 'shipping');
// By type, like the account order page: the method may since have been
// disabled, but the order still shows what was used.
$paymentMethodName = \Modules\Core\Payment\Models\PaymentMethod::where('type', $order->meta['payment_method'] ?? null)
->first()
?->translate('name');
// Lunar doesn't copy the coupon onto the order; the cart row keeps it.
$couponCode = $order->cart?->coupon_code;
$email = $order->billingAddress?->contact_email ?? $order->shippingAddress?->contact_email;
$comments = $order->shippingAddress?->delivery_instructions;
$muted = 'color:#5c5c5c;font-size:14px;';
$font = "font-family:'Manrope',Arial,Helvetica,sans-serif;";
@endphp
@section('title', "Η παραγγελία σου #{$reference} επιβεβαιώθηκε")
@section('preheader', "Ευχαριστούμε! Λάβαμε την παραγγελία σου #{$reference}, σύνολο {$total}.")
@section('content')
<h1 style="margin:0 0 16px;{{ $font }}font-size:22px;line-height:1.3;font-weight:700;color:#000000;">
Ευχαριστούμε για την παραγγελία σου!
</h1>
<p style="margin:0 0 24px;">
Λάβαμε την παραγγελία σου <strong>#{{ $reference }}</strong>
στις {{ $order->placed_at?->format('d/m/Y') }}.
Θα σε ενημερώσουμε με email μόλις σταλεί.
</p>
<div style="margin:0 0 40px;">
@include('emails.partials.button', [
'url' => route('account.orders.show', ['locale' => 'el', 'orderId' => $order->id]),
'label' => 'Δες την παραγγελία σου',
])
</div>
{{-- Items --}}
@include('emails.partials.section-heading', ['text' => 'Προϊόντα'])
<table role="presentation" width="100%" cellpadding="0" cellspacing="0" style="margin:0 0 8px;">
@foreach ($productLines as $line)
<tr>
<td width="64" valign="top" style="width:64px;padding:12px 12px 12px 0;{{ $loop->last ? '' : 'border-bottom:1px solid #e5e5e5;' }}">
@if ($thumb = $line->purchasable?->getThumbnailImage())
<img src="{{ $thumb }}" width="64" height="64" alt="{{ $line->description }}" style="display:block;width:64px;height:64px;object-fit:cover;background-color:#e5e5e5;border:0;{{ $font }}font-size:11px;color:#5c5c5c;">
@else
<div style="width:64px;height:64px;background-color:#e5e5e5;"></div>
@endif
</td>
<td valign="top" style="padding:12px 12px 12px 0;{{ $font }}font-size:15px;line-height:1.4;color:#000000;{{ $loop->last ? '' : 'border-bottom:1px solid #e5e5e5;' }}">
<strong>{{ $line->description }}</strong>
@if ($line->option)
<br><span style="{{ $muted }}">{{ $line->option }}</span>
@endif
{{-- Text answers only: photo answers are deliberately left out of emails. --}}
@foreach ($line->meta['custom_fields'] ?? [] as $field)
@if ($field['type'] !== 'file' && filled($field['value'] ?? null))
<br><span style="{{ $muted }}">{{ $field['label'] }}: {!! nl2br(e($field['value'])) !!}</span>
@endif
@endforeach
<br><span style="{{ $muted }}">
Ποσότητα: {{ $line->quantity }}@if ($line->quantity > 1) &times; {{ $line->unit_price->formatted() }}@endif
</span>
</td>
<td valign="top" align="right" style="padding:12px 0;white-space:nowrap;{{ $font }}font-size:15px;line-height:1.4;font-weight:700;color:#000000;{{ $loop->last ? '' : 'border-bottom:1px solid #e5e5e5;' }}">
{{ $line->sub_total?->formatted() }}
</td>
</tr>
@endforeach
</table>
{{-- Totals --}}
<table role="presentation" width="100%" cellpadding="0" cellspacing="0" style="margin:0 0 40px;border-top:1px solid #000000;">
<tr>
<td style="padding:12px 0 4px;{{ $font }}font-size:15px;color:#000000;">Υποσύνολο</td>
<td align="right" style="padding:12px 0 4px;white-space:nowrap;{{ $font }}font-size:15px;color:#000000;">{{ $order->sub_total?->formatted() }}</td>
</tr>
@if ($order->discount_total?->value > 0)
<tr>
<td style="padding:4px 0;{{ $font }}font-size:15px;color:#000000;">
Έκπτωση@if ($couponCode) <span style="{{ $muted }}">({{ $couponCode }})</span>@endif
</td>
<td align="right" style="padding:4px 0;white-space:nowrap;{{ $font }}font-size:15px;color:#000000;">&minus;{{ $order->discount_total->formatted() }}</td>
</tr>
@endif
<tr>
<td style="padding:4px 0;{{ $font }}font-size:15px;color:#000000;">
Μεταφορικά@if ($shippingLine) <span style="{{ $muted }}">({{ $shippingLine->description }})</span>@endif
</td>
<td align="right" style="padding:4px 0;white-space:nowrap;{{ $font }}font-size:15px;color:#000000;">
{{ $order->shipping_total?->value > 0 ? $order->shipping_total->formatted() : 'Δωρεάν' }}
</td>
</tr>
<tr>
<td style="padding:12px 0 0;border-top:1px solid #000000;{{ $font }}font-size:20px;line-height:1.3;font-weight:800;color:#000000;">Σύνολο</td>
<td align="right" style="padding:12px 0 0;border-top:1px solid #000000;white-space:nowrap;{{ $font }}font-size:20px;line-height:1.3;font-weight:800;color:#000000;">{{ $total }}</td>
</tr>
{{-- Prices include VAT (lunar.pricing.stored_inclusive_of_tax), so this is informational. --}}
@if ($order->tax_total?->value > 0)
<tr>
<td colspan="2" align="right" style="padding:4px 0 0;{{ $font }}{{ $muted }}">Περιλαμβάνεται Φ.Π.Α. {{ $order->tax_total->formatted() }}</td>
</tr>
@endif
</table>
{{-- Payment + shipping --}}
@include('emails.partials.section-heading', ['text' => 'Πληρωμή και αποστολή'])
<table role="presentation" width="100%" cellpadding="0" cellspacing="0" style="margin:0 0 40px;">
@foreach (array_filter([
'Τρόπος πληρωμής' => $paymentMethodName,
'Τρόπος αποστολής' => $shippingLine?->description,
'Παραστατικό' => ($order->meta['wants_invoice'] ?? false) ? 'Τιμολόγιο' : 'Απόδειξη',
'Email' => $email,
]) as $label => $value)
<tr>
<td valign="top" style="padding:4px 12px 4px 0;{{ $font }}{{ $muted }}line-height:1.5;">{{ $label }}</td>
<td valign="top" align="right" style="padding:4px 0;{{ $font }}font-size:15px;line-height:1.5;color:#000000;word-break:break-word;">{{ $value }}</td>
</tr>
@endforeach
</table>
{{-- Addresses: stacked, never side by side, so they read well on a phone. --}}
@if ($order->shippingAddress)
@include('emails.partials.section-heading', ['text' => 'Διεύθυνση αποστολής'])
<div style="margin:0 0 {{ $comments ? '16px' : '40px' }};">
@include('emails.partials.address', ['address' => $order->shippingAddress])
</div>
@if ($comments)
<p style="margin:0 0 40px;font-size:15px;line-height:1.6;">
<span style="{{ $muted }}">Σχόλια</span><br>
{!! nl2br(e($comments)) !!}
</p>
@endif
@endif
@if ($order->billingAddress)
@include('emails.partials.section-heading', ['text' => 'Στοιχεία χρέωσης'])
@include('emails.partials.address', ['address' => $order->billingAddress])
@endif
@endsection
@section('footer')
<p style="margin:0;">
Έχεις ερώτηση για την παραγγελία σου;
<a href="{{ route('contact', ['locale' => 'el']) }}" style="color:#7a7a7a;text-decoration:underline;">Επικοινώνησε μαζί μας</a>.
</p>
@endsection
@@ -1,3 +1,26 @@
<p>Hi,</p>
{{-- Core passes only the order reference here (and the amount for payment emails). Greek on purpose: sent from the queue in the app default locale. --}}
@extends('emails.layout')
<p>A refund of <strong>{{ $amount }}</strong> has been issued for your order <strong>{{ $reference }}</strong>.</p>
@section('title', "Έγινε επιστροφή χρημάτων")
@section('preheader', "Επιστρέψαμε {$amount} για την παραγγελία #{$reference}.")
@section('content')
<h1 style="margin:0 0 16px;font-family:'Manrope',Arial,Helvetica,sans-serif;font-size:22px;line-height:1.3;font-weight:700;color:#000000;">
Έγινε επιστροφή χρημάτων
</h1>
<p style="margin:0 0 32px;">Σου επιστρέψαμε <strong>{{ $amount }}</strong> για την παραγγελία <strong>#{{ $reference }}</strong>.</p>
@include('emails.partials.button', [
'url' => route('account.orders', ['locale' => 'el']),
'label' => 'Οι παραγγελίες μου',
])
@endsection
@section('footer')
<p style="margin:0;">
Έχεις ερώτηση για την παραγγελία σου;
<a href="{{ route('contact', ['locale' => 'el']) }}" style="color:#7a7a7a;text-decoration:underline;">Επικοινώνησε μαζί μας</a>.
</p>
@endsection
@@ -1,3 +1,34 @@
<p>Hi,</p>
{{-- Core passes only the order reference here (and the amount for payment emails). Greek on purpose: sent from the queue in the app default locale. --}}
@extends('emails.layout')
<p>Your order <strong>{{ $reference }}</strong> is now: <strong>{{ $statusLabel }}</strong></p>
@php
// Core passes Lunar's English label; map it back to the status key so the
// shared <x-order-status> can show the translated one. Interim, until core
// passes the order (or its status) to this view.
$status = collect(config('lunar.orders.statuses'))
->search(fn (array $config) => $config['label'] === $statusLabel) ?: $statusLabel;
@endphp
@section('title', "Ενημέρωση παραγγελίας")
@section('preheader', "Η παραγγελία σου #{$reference} ενημερώθηκε.")
@section('content')
<h1 style="margin:0 0 16px;font-family:'Manrope',Arial,Helvetica,sans-serif;font-size:22px;line-height:1.3;font-weight:700;color:#000000;">
Η παραγγελία σου ενημερώθηκε
</h1>
<p style="margin:0 0 32px;">Η κατάσταση της παραγγελίας σου <strong>#{{ $reference }}</strong> είναι τώρα: <strong><x-order-status :status="$status" /></strong></p>
@include('emails.partials.button', [
'url' => route('account.orders', ['locale' => 'el']),
'label' => 'Οι παραγγελίες μου',
])
@endsection
@section('footer')
<p style="margin:0;">
Έχεις ερώτηση για την παραγγελία σου;
<a href="{{ route('contact', ['locale' => 'el']) }}" style="color:#7a7a7a;text-decoration:underline;">Επικοινώνησε μαζί μας</a>.
</p>
@endsection