Add email templates, page layouts, and shop themes (template system)
Deploy to Production (witstore.wende.it) / deploy (push) Successful in 7s
Deploy to Production (witstore.wende.it) / deploy (push) Successful in 7s
- E-Mail-Templates: DB-gespeicherte HTML-Templates mit {{placeholder}}-System,
Admin-UI zum Bearbeiten von Betreff und Body, alle 4 Mailables aktualisiert
- Seiten-Layouts: 4 Layouts für CMS-Seiten (Standard, Sidebar, Volle Breite, Landing),
Layout-Auswahl im Admin-Formular
- Shop-Themes: 5 Farbthemen via CSS-Variablen, Picker in Einstellungen
- Deployment: EmailTemplateSeeder wird automatisch beim Deploy ausgeführt
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Mail;
|
||||
|
||||
use App\Models\EmailTemplate;
|
||||
use App\Models\Order;
|
||||
use App\Models\Setting;
|
||||
use Illuminate\Bus\Queueable;
|
||||
@@ -20,9 +21,29 @@ class PaymentReceivedMail extends Mailable
|
||||
|
||||
public function build()
|
||||
{
|
||||
$order = $this->order;
|
||||
$template = EmailTemplate::getByKey('payment_received');
|
||||
|
||||
if (!$template) {
|
||||
return $this
|
||||
->subject('Ihre Rechnung – ' . $order->order_number . ' – ' . Setting::get('shop_name'))
|
||||
->view('emails.payment_received')
|
||||
->attachData($this->pdfContent, $this->pdfFilename, ['mime' => 'application/pdf']);
|
||||
}
|
||||
|
||||
$customerName = $order->billingAddress()?->full_name ?? $order->guest_email;
|
||||
|
||||
$data = [
|
||||
'customer_name' => $customerName,
|
||||
'order_number' => $order->order_number,
|
||||
'order_total' => number_format($order->total, 2, ',', '.'),
|
||||
'shop_name' => Setting::get('shop_name'),
|
||||
'shop_email' => Setting::get('shop_email'),
|
||||
];
|
||||
|
||||
return $this
|
||||
->subject('Ihre Rechnung – ' . $this->order->order_number . ' – ' . Setting::get('shop_name'))
|
||||
->view('emails.payment_received')
|
||||
->subject($template->renderSubject($data))
|
||||
->html($template->renderBody($data))
|
||||
->attachData($this->pdfContent, $this->pdfFilename, ['mime' => 'application/pdf']);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user