@php // $lead, $inquiry, $customFields (already { label, value } rendered strings) $formLabel = $lead->form_name ?: ($lead->form_key ?: 'Website form'); $preheader = 'New website lead: ' . ($lead->name ?: 'Unnamed') . ' — ' . $formLabel; $identityRows = []; if (!empty($lead->name)) $identityRows[] = ['label' => 'Name', 'value' => e($lead->name)]; if (!empty($lead->email)) $identityRows[] = ['label' => 'Email', 'value' => '' . e($lead->email) . '']; if (!empty($lead->phone)) $identityRows[] = ['label' => 'Phone', 'value' => e($lead->phone)]; if (!empty($lead->form_name) || !empty($lead->form_key)) { $identityRows[] = ['label' => 'Form', 'value' => e($lead->form_name ?: $lead->form_key)]; } if (!empty($lead->source_type) || !empty($lead->source)) { $identityRows[] = ['label' => 'Source', 'value' => e($lead->source_type ?: $lead->source)]; } if (!empty($lead->source_url)) { $identityRows[] = ['label' => 'From Page', 'value' => '' . e($lead->source_url) . '']; } $when = $lead->submitted_at ?: $lead->created_at; if ($when) $identityRows[] = ['label' => 'Submitted', 'value' => e($when->format('D, M j Y g:i A'))]; $customRows = []; foreach ($customFields as $f) { $customRows[] = ['label' => $f['label'], 'value' => e($f['value'])]; } $utmRows = []; foreach (['utm_source','utm_medium','utm_campaign','utm_term','utm_content'] as $u) { if (!empty($lead->{$u})) $utmRows[] = ['label' => strtoupper(str_replace('_', ' ', $u)), 'value' => e($lead->{$u})]; } @endphp @extends('emails.layouts.stepup', ['preheader' => $preheader, 'heading' => 'New Website Lead']) @section('body')

A new lead was submitted via the website.

@include('emails.components.summary-table', ['title' => 'Lead', 'rows' => $identityRows]) @if(!empty($customRows)) @include('emails.components.summary-table', ['title' => 'Inquiry Details', 'rows' => $customRows]) @endif @if(!empty($inquiry) && !empty($inquiry->message)) @php $brand = config('company.brand'); @endphp
Message
{{ $inquiry->message }}
@endif @if(!empty($utmRows)) @include('emails.components.summary-table', ['title' => 'Campaign', 'rows' => $utmRows]) @endif @endsection