@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| @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 |