From b4fe0a1415056feb46da323f1e7de50c62b7a48a Mon Sep 17 00:00:00 2001 From: Sanjeev Papnoi Date: Tue, 7 Jan 2020 15:53:04 +0530 Subject: [PATCH] mail to customer issue fixed --- Workflow/Actions/Ticket/MailCustomer.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Workflow/Actions/Ticket/MailCustomer.php b/Workflow/Actions/Ticket/MailCustomer.php index 41bee6353..89a016b7b 100644 --- a/Workflow/Actions/Ticket/MailCustomer.php +++ b/Workflow/Actions/Ticket/MailCustomer.php @@ -56,6 +56,7 @@ public static function applyAction(ContainerInterface $container, $entity, $valu // Only process attachments if required in the message body // @TODO: Revist -> Maybe we should always include attachments if they are provided?? + $attachments = []; if (!empty($createdThread) && (strpos($emailTemplate->getMessage(), '{%ticket.attachments%}') !== false || strpos($emailTemplate->getMessage(), '{% ticket.attachments %}') !== false)) { $attachments = array_map(function($attachment) use ($container) { return str_replace('//', '/', $container->get('kernel')->getProjectDir() . "/public" . $attachment->getPath()); @@ -65,7 +66,8 @@ public static function applyAction(ContainerInterface $container, $entity, $valu $ticketPlaceholders = $container->get('email.service')->getTicketPlaceholderValues($entity); $subject = $container->get('email.service')->processEmailSubject($emailTemplate->getSubject(), $ticketPlaceholders); $message = $container->get('email.service')->processEmailContent($emailTemplate->getMessage(), $ticketPlaceholders); - + + $thread = ($thread != null) ? $thread : $createdThread; if (!empty($thread)) { $headers = ['References' => $entity->getReferenceIds()];