@php /** * Branded HTML email shell. The admin edits only the inner body of each template; this * fixed wrapper supplies the header (logo/site name on a primary-colour band), the white * content card and the footer, so every email stays on-brand. The colour is the LIVE * `primary_color` setting, so changing Branding recolours all emails automatically. * * Email clients ignore external CSS, so everything here is table-based + inline-styled by * necessity (this is the one place bespoke inline styles are expected — not app.css). * * @var string $primary brand primary colour (hex) * @var string $siteName * @var string $logoUrl absolute logo URL ('' to fall back to the site name) * @var string $bodyHtml the template's rendered inner content * @var string $siteUrl * @var int $year * @var string $preheader the inbox snippet ('' to let the client scrape the body, as before) */ $primary = $primary ?? '#ff003d'; $siteName = $siteName ?? 'QuickMunch'; $logoUrl = $logoUrl ?? ''; $bodyHtml = $bodyHtml ?? ''; $siteUrl = $siteUrl ?? ''; $year = $year ?? (int) date('Y'); $preheader = trim((string) ($preheader ?? '')); /* The recipient's direction, not the developer's. Every message shipped `lang="en"` with no `dir`, so an Arabic customer received a right-to-left language laid out left-to-right - in all twelve templates. `dir` is repeated on and on the outer table because mail clients are inconsistent about honouring it on alone, and Outlook's Word engine reads it off the table; `direction` inline is the belt to that pair of braces. */ $emailDir = lang_dir(); $emailRtl = $emailDir === 'rtl'; @endphp {{ $siteName }} @if ($preheader !== '') @php /* The inbox snippet, printed after the subject in Gmail, Outlook and Apple Mail. It must be the first text in the document and invisible in the rendered message, hence the hidden div (mso-hide:all is the Word engine's own switch — display:none alone leaks in Outlook). The run of invisible characters after it is not padding for its own sake: a client fills its snippet to a fixed length, so without them it appends the opening words of the body and the preheader reads "Your order is on its way Hi Grace,". Zero-width joiner plus zero-width no-break space is the pair that survives Gmail's sanitiser. */ @endphp
{{ $preheader }}{{ str_repeat('‌', 60) }}
@endif
@php /* width="100%" capped by max-width, NOT width="600". A table with a specified PIXEL width contributes that 600px as its min-content width, so the wrapping td's 24px of padding grew the row to 624 and `max-width:100%` then resolved against a box the card had itself sized — it could never shrink. Every one of the twelve shipped templates scrolled horizontally: +24px on a 600px client, +249px on a 375px phone, in both directions. Measured across 48 renders, not reasoned about. */ @endphp @php /* The logo sits on WHITE, never on the brand band. In a white-label product the band colour and the logo are the same brand colour by definition, so the mark disappears into its own header: measured on the shipped logo, 55% of its opaque pixels were within 90 (RGB distance) of the band. A neutral surface is the only header that is safe for a logo the buyer uploads and we never see. The brand colour stays, as the rule beneath it — its own row rather than a td border, which the Word engine that renders Outlook on Windows drops. With no logo there is nothing to protect, so the site name keeps the full colour band it was designed for. */ @endphp @if ($logoUrl !== '') @else @endif
{{ $siteName }}
 
{{ $siteName }}
{!! $bodyHtml !!}

© {{ (int) $year }} {{ $siteName }}@if ($siteUrl !== '') · {{ preg_replace('#^https?://#', '', $siteUrl) }}@endif
@php /* Translated like every other string. This one sentence was hardcoded English in a file that correctly emits `dir` and `lang` above — so an Arabic recipient received a properly right-to-left email whose only sentence was in English. */ @endphp {{ t_raw('email.footer_reason', [':site' => $siteName]) }}