1
0
mirror of https://github.com/freescout-helpdesk/freescout.git synced 2024-11-25 03:43:33 +01:00

Sort threads in emails to customers by thread ID instead of created_at - closes #532

This commit is contained in:
FreeScout 2020-05-28 02:21:14 -07:00
parent 9a1ae415ce
commit 7451223e09
4 changed files with 4 additions and 4 deletions

View File

@ -51,7 +51,7 @@ class SendNotificationToUsers implements ShouldQueue
// Threads has to be sorted here, if sorted before, they come here in wrong order
$this->threads = $this->threads->sortByDesc(function ($item, $key) {
return $item->created_at;
return $item->id;
});
$headers = [];

View File

@ -87,7 +87,7 @@ class SendReplyToCustomer implements ShouldQueue
// Threads has to be sorted here, if sorted before, they come here in wrong order
$this->threads = $this->threads->sortByDesc(function ($item, $key) {
return $item->created_at;
return $item->id;
});
$new = false;

View File

@ -49,7 +49,7 @@
{!! $thread->body !!}
@action('reply_email.before_signature', $thread, $loop, $threads, $conversation, $mailbox)
@if ($thread->source_via == App\Thread::PERSON_USER)
@if ($thread->source_via == App\Thread::PERSON_USER && \Eventy::filter('reply_email.include_signature', true, $thread))
<br>{!! $conversation->getSignatureProcessed(['thread' => $thread]) !!}
@endif
@action('reply_email.after_signature', $thread, $loop, $threads, $conversation, $mailbox)

View File

@ -3,7 +3,7 @@
-----------------------------------------------------------
@if (!$loop->first)## {{--@if ($loop->last){{ __(':person sent a message', ['person' => $thread->getFromName($mailbox)]) }}@else {{ __(':person replied', ['person' => $thread->getFromName($mailbox)]) }}@endif--}}{{ $thread->getFromName($mailbox) }}, {{ __('on :date', ['date' => App\Customer::dateFormat($thread->created_at, 'M j @ H:i')]) }} ({{ \Config::get('app.timezone') }}):@endif
{{-- Html2Text\Html2Text::convert($thread->body) - this was causing "AttValue: " expected in Entity" error sometimes --}}{{ (new Html2Text\Html2Text($thread->body))->getText() }}
@if ($thread->source_via == App\Thread::PERSON_USER)
@if ($thread->source_via == App\Thread::PERSON_USER && \Eventy::filter('reply_email.include_signature', true, $thread))
{{-- Html2Text\Html2Text::convert($conversation->mailbox->signature) --}}{{ (new Html2Text\Html2Text($conversation->getSignatureProcessed(['thread' => $thread])))->getText() }}
@endif