@extends('backend.layouts.app')
@section('content')
<div class="row page-titles">
    <div class="col-md-5 align-self-center">
        <h4 class="text-themecolor">View Email Templates</h4>
    </div>
    <div class="col-md-7 align-self-center text-right">
        <div class="d-flex justify-content-end align-items-center">
            <ol class="breadcrumb">
                <li class="breadcrumb-item"><a href="{{ route('dashboard') }}">Dashboard</a></li>
                <li class="breadcrumb-item "><a href="{{ route('dashboard') }}">Email Templates</a></li>
                <li class="breadcrumb-item active">View Email Templates</li>

            </ol>
            @can('Email Template-edit')
            <a href="{{ route('email.edit',['id' => $email->id] + request()->query()) }}"> <button type="button" class="btn btn-info d-none d-lg-block m-l-15"><i class="fa fa-edit"></i> Edit</button></a>
        @endcan
        </div>
    </div>
</div>
<div class="container-fluid">
    <section class="content">
            <div class="row">
                <div class="col-12">
                    <div class="card">

                        <div class="card-body">
                        <div class="card-title" style="width:100%;display: inline-block;">
                                   <span class="caption-subject font-green bold uppercase">View Email</span>
                                <a href="{{ route('email') }}"> <button type="button" class="btn btn-primary btn-sm float-right"><i class="fa fa-arrow-left"></i> Back</button></a>

                                </div>
                                <table id="example2" class="table table-bordered table-striped">
                                    <tr>
                                        <th>Name</th>
                                        <td>{{ $email->name }}</td>
                                    </tr>
                                    <tr>
                                        <th>Slugs</th>
                                        <td>{{ $email->slug }}</td>
                                    </tr>
                                    <tr>
                                        <th>CC Mails</th>
                                        <td>
                                                @php
                                                    $ccEmails = explode(',', $email->cc_emails);
                                                @endphp
                                                <ul>
                                                    @foreach ($ccEmails as $ccEmail)
                                                        <li>{{ trim($ccEmail) }}</li>
                                                    @endforeach
                                                </ul>
                                            </td>
                                    </tr>
                                    <tr>
                                        <th>BCC Mails</th>
                                        <td>
                                                @php
                                                    $bccEmails = explode(',', $email->bcc_emails);
                                                @endphp
                                                <ul>
                                                    @foreach ($bccEmails as $bccEmail)
                                                        <li>{{ trim($bccEmail) }}</li>
                                                    @endforeach
                                                </ul>
                                            </td>                                    </tr>
                                    <tr>
                                        <th>Subjects</th>
                                        <td>
                                           {{ $email->subject }}
                                        </td>
                                    </tr>
                                    <tr>
                                        <th>Description</th>
                                        <td>
                                            {!! $email->description !!}
                                        </td>
                                    </tr>

                                    <tr>
                                        <th>Created At</th>
                                        <td>{{ $email->created_at? $email->created_at->format(config('GET.admin_date_time_format') ?? 'Y-m-d'):'' }}</td>
                                    </tr>
                                    <tr>
                                        <th>Updated At</th>
                                        <td>{{ $email->updated_at? $email->updated_at->format(config('GET.admin_date_time_format') ?? 'Y-m-d'):'' }}</td>
                                    </tr>
                                    <tr>
                                        <th>Status</th>
                                        <td>
                                            @if ($email->status == 1)
                                                <span class="label label-success label-rounded">Active</span>
                                            @else
                                                <span class="label label-danger label-rounded">Inactive</span>
                                            @endif
                                        </td>
                                    </tr>
                            </table>

                        </div>
                    </div>
                </div>
            </div>

    </section>
</div>
@stop
