@if ($thread->type == App\Thread::TYPE_LINEITEM)
{!! $thread->getActionText('', true, false, null, view('conversations/thread_by', ['thread' => $thread])->render()) !!}
@action('thread.after_header', $thread, $loop, $threads, $conversation, $mailbox)
@elseif ($thread->type == App\Thread::TYPE_MESSAGE && $thread->state == App\Thread::STATE_DRAFT)
@include('conversations/thread_by') @if ($thread->isForward()) {{ __('are forwarding') }} @else   @endif [{{ __('Draft') }}]
@action('thread.after_header', $thread, $loop, $threads, $conversation, $mailbox)
@action('thread.before_body', $thread, $loop, $threads, $conversation, $mailbox) {!! $thread->getCleanBody() !!} @include('conversations/partials/thread_attachments')
@else
@include('partials/person_photo', ['person' => $thread->getPerson(true)])
@if ($thread->isForward())
@endif @if ($conversation->isPhone() && $thread->first)
@endif
@if ($thread->type == App\Thread::TYPE_CUSTOMER) @if ($thread->customer_cached) @if (\Helper::isPrint()) {{ $thread->customer_cached->getFullName(true) }} @else {{ $thread->customer_cached->getFullName(true) }} @endif @endif @else @if (\Helper::isPrint()) {{ $thread->created_by_user_cached->getFullName() }} @else @include('conversations/thread_by', ['as_link' => true]) @endif @endif @if (\Helper::isPrint()) <{{ ($thread->type == App\Thread::TYPE_CUSTOMER ? $thread->customer_cached->getMainEmail() : $thread->created_by_user_cached->email ) }}> @if ($thread->isNote()) [{{ __('Note') }}] @endif @endif {{-- Lines below must be spaceless --}} {{ \Eventy::action('thread.after_person_action', $thread, $loop, $threads, $conversation, $mailbox) }}
@if ($thread->type != App\Thread::TYPE_NOTE || $thread->isForward())
@action('thread.before_recipients', $thread, $loop, $threads, $conversation, $mailbox) @if ($thread->isUserMessage() && $thread->from && array_key_exists($thread->from, $mailbox->getAliases()))
{{ __("From") }}: {{ $thread->from }}
@endif @if (($thread->isForward() || $loop->last || ($thread->type == App\Thread::TYPE_CUSTOMER && count($thread->getToArray($mailbox->getEmails()))) || ($thread->type == App\Thread::TYPE_MESSAGE && !in_array($conversation->customer_email, $thread->getToArray())) || ($thread->type == App\Thread::TYPE_MESSAGE && count($customer->emails) > 1) || \Helper::isPrint()) && $thread->getToArray() )
{{ __("To") }}: {{ implode(', ', $thread->getToArray()) }}
@endif @if ($thread->getCcArray())
{{ __("Cc") }}: {{ implode(', ', $thread->getCcArray()) }}
@endif @if ($thread->getBccArray())
{{ __("Bcc") }}: {{ implode(', ', $thread->getBccArray()) }}
@endif @action('thread.after_recipients', $thread, $loop, $threads, $conversation, $mailbox)
@endif
@action('thread.info.prepend', $thread) @if ($thread->type == App\Thread::TYPE_NOTE) {{--{{ __('Note') }} · --}} @else @if (in_array($thread->type, [App\Thread::TYPE_CUSTOMER, App\Thread::TYPE_MESSAGE])) @php if (!empty($thread_num)) { $thread_num--; } else { $thread_num = $conversation->threads_count; } if (!isset($is_first) && ($thread->type == App\Thread::TYPE_CUSTOMER || $thread->type == App\Thread::TYPE_MESSAGE)) { $is_first = true; } elseif (isset($is_first)) { $is_first = false; } @endphp @if (!empty($is_first) && $conversation->threads_count > 2) @endif {{--#{{ $thread_num }} · --}} @endif @endif @if (!\Helper::isPrint()) {{ App\User::dateDiffForHumans($thread->created_at) }}
@else {{ App\User::dateFormat($thread->created_at) }}
@endif {{--#{{ $thread_index+1 }}--}} @if (in_array($thread->type, [App\Thread::TYPE_CUSTOMER, App\Thread::TYPE_MESSAGE, App\Thread::TYPE_NOTE])) @if ($loop->last || (!$loop->last && $thread->status != App\Thread::STATUS_NOCHANGE && $thread->status != $threads[$loop->index+1]->status)) @php $show_status = true; @endphp @else @php $show_status = false; @endphp @endif @if ($loop->last || (!$loop->last && ($thread->user_id != $threads[$loop->index+1]->user_id || $threads[$loop->index+1]->action_type == App\Thread::ACTION_TYPE_USER_CHANGED)) ) @if ($thread->user_id) @if ($thread->user_cached) {{ $thread->user_cached->getFullName() }}@if (!empty($show_status)),@endif @endif @else {{ __("Anyone") }}@if (!empty($show_status)),@endif @endif @endif @if (!empty($show_status)) {{ $thread->getStatusName() }} @endif @endif
@action('thread.after_header', $thread, $loop, $threads, $conversation, $mailbox)
@php $send_status_data = $thread->getSendStatusData(); @endphp @if ($send_status_data) @if (!empty($send_status_data['is_bounce']))
@if (empty($send_status_data['bounce_for_thread']) || empty($send_status_data['bounce_for_conversation'])) {{ __('This is a bounce message.') }} @else @php $bounce_for_conversation = App\Conversation::find($send_status_data['bounce_for_conversation']); @endphp @if ($bounce_for_conversation) {!! __('This is a bounce message for :link', [ 'link' => '#'.$bounce_for_conversation->number.'' ]) !!} @endif @endif
@endif @endif @if ($thread->isSendStatusError())
{{ __('Message not sent to customer') }} ({{ __('View log') }}) @if ($thread->canRetrySend())   @endif
@if (!empty($send_status_data['bounced_by_thread']) && !empty($send_status_data['bounced_by_conversation'])) @php $bounced_by_conversation = App\Conversation::find($send_status_data['bounced_by_conversation']); @endphp @if ($bounced_by_conversation) {!! __('Message bounced (:link)', [ 'link' => '#'.$bounced_by_conversation->number.'' ]) !!} @endif @endif @if (!empty($send_status_data['msg'])) {{ $send_status_data['msg'] }} @endif
@endif @if ($thread->isForwarded())
{{ __('This is a forwarded conversation.') }} {!! __('Original conversation: :forward_parent_conversation_number', [ 'forward_parent_conversation_number' => '#'.$thread->getMetaFw(App\Thread::META_FORWARD_PARENT_CONVERSATION_NUMBER).'' ]) !!}
@endif @if ($thread->isForward())
{!! __(':person forwarded this conversation. Forwarded conversation: :forward_child_conversation_number', [ 'person' => ucfirst($thread->getForwardByFullName()), 'forward_child_conversation_number' => '#'.$thread->getMetaFw(App\Thread::META_FORWARD_CHILD_CONVERSATION_NUMBER).'' ]) !!}
@endif @action('thread.before_body', $thread, $loop, $threads, $conversation, $mailbox)
{!! \Eventy::filter('thread.body_output', $thread->getBodyWithFormatedLinks(), $thread, $conversation, $mailbox) !!}
@if ($thread->body_original)
{{ __("Edited by :whom :when", ['whom' => $thread->getEditedByUserName(), 'when' => App\User::dateDiffForHumansWithHours($thread->edited_at)]) }}  {{ __("Show original") }}
@endif @if ($thread->opened_at)
{{ __("Customer viewed :when", ['when' => App\User::dateDiffForHumansWithHours($thread->opened_at)]) }}
@endif @action('thread.meta', $thread, $loop, $threads, $conversation, $mailbox) @include('conversations/partials/thread_attachments')
@endif