@component('mail::message') {!! $data['message'] !!} @php $opportunity = (!empty($order->opportunities) && !empty($order->opportunities->first())) ? $order->opportunities->first() : $order->customerPurchaseOrders->first()->opportunity; $finalisedQuote = ($opportunity) ? $opportunity->finalisedQuote : null; $quotes = ($opportunity) ? $opportunity->quotes : null; $customerPO = $order->customerPurchaseOrders->first(); $type = $order->status; @endphp

Materials Request [{{$type}}]: {{$order->order_number}}

@component('mail::button', ['url' => route('order-view', $order->id), 'color' => 'primary']) View Material Request @endcomponent @if($customerPO)

Customer PO: {{$customerPO->name}}

@component('mail::button', ['url' => route('customer-purchase-order-view', $customerPO->id), 'color' => 'primary']) View Customer PO @endcomponent @endif @if($opportunity) @endif @if($quotes) @component('mail::subcopy')

Associated Quotes: @foreach($quotes as $quote) {{$quote->name}}{{ ($quote->version_number > 1) ? " v.".$quote->version_number : ""}} @endforeach

@endcomponent @endif @component('mail::subcopy') If you're having trouble clicking the buttons, please login into the SNAPP CRM system and check relevant information: [{{ url('/') }}]({{ url('/') }}) @endcomponent @endcomponent