Viewing file: compose.blade.php (11.65 KB) -rw-r--r-- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
@extends('layouts.customer')
@section('title','Compose | EmailBox')
@section('extra-css') <link rel="stylesheet" href="{{asset('plugins/select2/css/select2.min.css')}}"> <link rel="stylesheet" href="{{asset('plugins/daterangepicker/daterangepicker.css')}}"> <link rel="stylesheet" href="{{asset('plugins/icheck-bootstrap/icheck-bootstrap.min.css')}}"> <link href="https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css" rel="stylesheet"> <style> #select2-toNumbers-results, #select2-fromNumber-results{ overflow-y: auto; max-height: 200px; } .icheck-success>input:first-child:checked+input[type=hidden]+label::before, .icheck-success>input:first-child:checked+label::before { background-color: #2f4cdd !important; border-color: #2f4cdd !important; } </style> @if(get_settings('tinymc_api_key')) <script src="https://cdn.tiny.cloud/1/{{get_settings('tinymc_api_key')}}/tinymce/6/tinymce.min.js" referrerpolicy="origin"></script> @endif @endsection
@section('content')
<!-- Content Header (Page header) --> <section class="content-header"> <div class="container-fluid"> <div class="row mb-2"> <div class="col-sm-6"> <h1>{{trans('customer.compose')}}</h1> </div> <div class="col-sm-6"> <ol class="breadcrumb float-sm-right"> <li class="breadcrumb-item"><a href="{{route('customer.emailbox.inbox')}}">{{trans('customer.emailbox')}}</a></li> <li class="breadcrumb-item active">{{trans('customer.inbox')}}</li> </ol> </div> </div> </div><!-- /.container-fluid --> </section>
<!-- Main content --> <section class="content"> <div class="row"> <div class="col-md-3"> <a href="{{route('customer.emailbox.inbox')}}" class="btn btn-primary btn-block mb-3">{{trans('customer.back_to_sent')}}</a> @include('customer.emailbox.common') </div> <!-- /.col --> <div class="col-md-9"> <div class="card card-primary card-outline"> <form id="compose_form" action="{{route('customer.emailbox.compose.sent')}}" method="post" enctype="multipart/form-data"> @csrf <div class="card-header"> <h3 class="card-title">{{trans('customer.compose_new_message')}}</h3> </div> <!-- /.card-header --> <div class="card-body"> <div id="pre_draft"> @isset($draft) <input type='hidden' id='draft_id' name='draft_id' value='{{$draft->id}}'/> @endisset </div> <div class="row pb-3"> <div class="col-sm-6"> <label >{{trans('customer.from')}}:</label> <select class="form-control" name="from_email" id="fromEmail"> @if($senders) @foreach($senders as $sender) <option {{isset($draft) && isset($draft->formatted_email_from) && $draft->formatted_email_from==$sender->from_mail?'selected':''}} value="{{$sender->from_mail.'@'.$sender->domain}}" data-reply-to="{{$sender->reply_to}}" data-from-name="{{$sender->name}}">{{$sender->from_mail.'@'.$sender->domain}}</option> @endforeach @endif </select> </div>
<div class="col-sm-6"> <label >{{trans('From Name')}}:</label> <input type="text" name="from_name" value="{{isset($draft) && isset($draft->from_name)?$draft->from_name:''}}" id="fromName" class="form-control" placeholder="Example Name"> </div> <div class="col-sm-6 mt-2"> <label >{{trans('Reply To')}}:</label> <input type="text" name="reply_to" id="replyTo" value="{{isset($draft) && isset($draft->reply_to)?$draft->reply_to:''}}" class="form-control" placeholder="E.X: replyto@demo.com"> </div>
<div class="col-sm-6 mt-2"> <label >{{trans('Subject')}}:</label> <input type="text" name="subject" value="{{isset($draft) && isset($draft->subject)?$draft->subject:''}}" id="subject" class="form-control" placeholder="Enter Email Subject"> </div> </div>
<div class="form-group"> <div class="row"> <div class="col-sm-12"> <label for="">Reciepient Emails</label> <select name="to_email[]" id="toEmail" class="select2 compose-select" multiple="multiple" data-placeholder="{{trans('customer.recipient')}}:">
@if(isset($draft) && $draft->formatted_email_to) @foreach($draft->formatted_email_to_array as $to) <option selected value="{{$to}}">{{$to}}</option> @endforeach @endif @isset($users_to_contacts) <optgroup label="Contacts"> @foreach($users_to_contacts as $to) <option value="{{json_encode($to)}}">{{$to['value']}}</option> @endforeach </optgroup> @endisset
@isset($users_to_groups) <optgroup label="Groups"> @foreach($users_to_groups as $to) <option value="{{json_encode($to)}}">{{$to['value']}}</option> @endforeach </optgroup> @endisset </select> </div> </div> </div> <div class="form-group"> <label for="attach_files">{{trans('customer.compose_new_message')}}:</label> <textarea name="body" id="compose-textarea" class="form-control compose-body" placeholder="{{trans('customer.enter_message')}}">{{isset($draft)?$draft->body:''}}</textarea> </div> <div class="form-group"> <label for="attach_files">{{trans('customer.choose_file')}}:</label> <input type="file" accept="image/*" id="attach_files" class="form-control" name="attach_files[]" multiple> </div> <div class="form-group">
<div class="icheck-success"> <input {{isset($draft) && $draft->schedule_datetime?'checked':''}} name="isSchedule" type="checkbox" id="isScheduled"> <label for="isScheduled"> {{trans('customer.schedule')}} </label> </div>
<input style="display: {{isset($draft) && $draft->schedule_datetime?'block':'none'}}" name="schedule" value="{{isset($draft) && $draft->schedule_datetime?$draft->schedule_datetime->format('m/d/Y h:i A'):''}}" id="schedule" type='text' class="form-control"/> </div>
</div> <!-- /.card-body --> <div class="card-footer"> <div class="float-right"> <button id="draft" type="button" class="btn btn-default"><i class="fas fa-pencil-alt"></i> {{trans('customer.draft')}} </button> <button type="submit" class="btn btn-primary"><i class="far fa-envelope"></i> {{trans('customer.send')}} </button> </div> <button id="reset" type="button" class="btn btn-default"><i class="fas fa-times"></i> {{trans('customer.reset')}} </button> </div> <!-- /.card-footer --> </form> </div> <!-- /.card --> </div> </div> <!-- /.row --> </section> <!-- /.content -->
@endsection
@section('extra-scripts') <script src="{{asset('js/customer/compose.js')}}"></script> <script src="https://code.jquery.com/jquery-3.5.1.min.js"></script> <script src="https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js"></script> <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/daterangepicker/daterangepicker.min.js" defer></script> <script> fromEmail.on('change', function(e) { const reply_to = $(this).find(':selected').attr('data-reply-to'); const from_name = $(this).find(':selected').attr('data-from-name'); $('#fromName').val(from_name).trigger('change'); $('#replyTo').val(reply_to).trigger('change'); });
@if(get_settings('tinymc_api_key')) tinymce.init({ selector: '#compose-textarea', menubar: 'edit insert format table', plugins: 'anchor autolink charmap codesample emoticons image link lists media searchreplace table visualblocks wordcount', toolbar: 'undo redo | blocks fontfamily fontsize | bold italic underline strikethrough | link image media table mergetags | addcomment showcomments | spellcheckdialog a11ycheck | align lineheight | numlist bullist indent outdent | emoticons charmap | removeformat', tinycomments_mode: 'embedded', tinycomments_author: 'Pico Technology', mergetags_list: [ { value: 'first_name', title: 'First Name' }, { value: 'last_name', title: 'Last name' }, { value: 'email', title: 'Email' }, ] }); @endif </script>
@endsection
|