@extends('layouts.master')
@section('content')

<div class="content-wrapper">
    <div class="content-header">
        <div class="container-fluid">
            <div class="row mb-2">
                <div class="col-sm-6">
                    <h1 class="m-0">Send Email</h1>
                </div>
                <div class="col-sm-6">
                    <ol class="breadcrumb float-sm-right">
                        <li class="breadcrumb-item"><a href="{{ route('dashboard') }}">Home</a></li>
                        <li class="breadcrumb-item"><a href="{{ route('users.list') }}">Team Member List</a></li>
                        <li class="breadcrumb-item active">Send Email</li>
                    </ol>
                </div>
            </div>
        </div>
    </div>
    <div class="content">
        <div class="container-fluid">
            <div class="row">
                <div class="col-12">
                    <div class="card">
                        <div class="card-header">
                            <h3 class="card-title">Send Email
                            </h3>
                            <div class="card-tools">
                                <button type="button" class="btn btn-tool" data-card-widget="collapse"
                                    title="Collapse">
                                    <i class="fas fa-minus"></i>
                                </button>
                            </div>
                        </div>
                        <div class="card-body">
                            <div class="row">
                                <form method="post" action="{{ route('users.store_email_admin') }}">
                                    @csrf
                                    <div class="col-12">
                                        <div class="card-header">
                                            <h3 class="card-title">ADMIN CONFIGURATION</h3>
                                        </div>
                                        <br>
                                        <input type='hidden' name="id" value="{{$CustomerID}}">
                                        <div class="form-group">
                                            <label for="">Sender Name</label>
                                            <input type="text" name="sender_name" class="form-control" id="" placeholder="Enter Sender Name"
                                                value="{{isset($users->sender_name) ? $users->sender_name : ""}}">
                                        </div>
                                        <div class="form-group">
                                            <label for="">Sender Email</label>
                                            <input type="text" name="sender_email" class="form-control" id="" placeholder="Enter Sender Email"
                                                value="{{isset($users->sender_email) ? $users->sender_email : ""}}">
                                        </div>
                                        <div class="form-group">
                                            <label for="">CC Email</label>
                                            <input type="text" name="cc_email" class="form-control" id="" placeholder="Enter CC Email"
                                                value="{{isset($users->cc_email) ? $users->cc_email : ""}}">
                                        </div>
                                        <div class="form-group">
                                            <label for="">BCC Email</label>
                                            <input type="text" name="bcc_email" class="form-control" id="" placeholder="Enter BCC Email"
                                                value="{{isset($users->bcc_email) ? $users->bcc_email : ""}}">
                                        </div>
                                    </div>
                                    <div class="card-footer">
                                        <button type="submit" nam="submit" class="btn btn-primary">Submit</button>
                                    </div>
                                </form>
                            </div>
                            <br>
                            <br>
                            <form method="post" action="{{ route('users.store_email') }}">
                                @csrf
                                <div class="row">
                                    <div class="card-header">
                                        <h3 class="card-title">SMTP DETAILS</h3>
                                    </div>
                                    <br>
                                    <div class="col-6">
                                        <br>
                                        <input type='hidden' name="id" value="{{$CustomerID}}">
                                        <div class="form-group">
                                            <label for="">Smtp Transport</label>
                                            <input type="text" name="smtp_transport" class="form-control" id="" placeholder="Smtp"
                                                value="{{isset($user_emailconfig->smtp_transport) ? $user_emailconfig->smtp_transport : "smtp"}}" required>
                                        </div>
                                        <div class="form-group">
                                            <label for="">Host</label>
                                            <input type="text" name="host" class="form-control" id="" placeholder="Enter Host"
                                                value="{{isset($user_emailconfig->host) ? $user_emailconfig->host : ""}}" required>
                                        </div>
                                        <div class="form-group">
                                            <label for="">Port</label>
                                            <input type="text" name="port" class="form-control" id="" placeholder="Enter Port"
                                                value="{{isset($user_emailconfig->port) ? $user_emailconfig->port : ""}}" required>
                                        </div>
                                    </div>
                                    <div class="col-6">
                                        <br>
                                        <div class="form-group">
                                            <label for="">User Name</label>
                                            <input type="text" name="username" class="form-control" id="" placeholder="Enter User Name"
                                                value="{{isset($user_emailconfig->username) ? $user_emailconfig->username : ""}}" required>
                                        </div>
                                        <div class="form-group">
                                            <label for="">Password</label>
                                            <input type="password" name="password" class="form-control" id="" placeholder="Enter Password"
                                                value="{{isset($user_emailconfig->password) ? $user_emailconfig->password : ""}}" required>
                                        </div>
                                        <div class="form-group">
                                            <label for="">Smtp Encryption</label>
                                            <input type="text" name="smtp_encryption" class="form-control" id="" placeholder="Enter Smtp Encryption"
                                                value="{{isset($user_emailconfig->smtp_encryption) ? $user_emailconfig->smtp_encryption : ""}}" required>
                                        </div>
                                    </div>
                                    <div class="card-footer">
                                        <button type="submit" nam="submit" class="btn btn-primary">Submit</button>
                                    </div>
                                </div>
                            </form>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

@endsection
