diff --git a/api/BusinessLogic/Emails/EmailTemplateParser.php b/api/BusinessLogic/Emails/EmailTemplateParser.php index 927a0d00..874b861c 100644 --- a/api/BusinessLogic/Emails/EmailTemplateParser.php +++ b/api/BusinessLogic/Emails/EmailTemplateParser.php @@ -221,7 +221,7 @@ class EmailTemplateParser { $msg = str_replace('%%PRIORITY%%', $priority, $msg); $msg = str_replace('%%OWNER%%', $owner, $msg); $msg = str_replace('%%STATUS%%', $statusName, $msg); - $msg = str_replace('%%EMAIL%%', $ticket->email, $msg); + $msg = str_replace('%%EMAIL%%', implode(';',$ticket->email), $msg); $msg = str_replace('%%CREATED%%', $ticket->dateCreated, $msg); $msg = str_replace('%%UPDATED%%', $ticket->lastChanged, $msg); $msg = str_replace('%%ID%%', $ticket->id, $msg); diff --git a/api/Controllers/Tickets/ResendTicketEmailToCustomerController.php b/api/Controllers/Tickets/ResendTicketEmailToCustomerController.php index 2a859047..79fb5a62 100644 --- a/api/Controllers/Tickets/ResendTicketEmailToCustomerController.php +++ b/api/Controllers/Tickets/ResendTicketEmailToCustomerController.php @@ -40,8 +40,10 @@ class ResendTicketEmailToCustomerController extends InternalApiController { } $reply = null; + $emailTemplate = EmailTemplateRetriever::NEW_TICKET; if (isset($_GET['replyId'])) { $replyId = $_GET['replyId']; + $emailTemplate = EmailTemplateRetriever::NEW_REPLY_BY_STAFF; foreach ($ticket->replies as $ticketReply) { if ($ticketReply->id === $replyId) { @@ -63,6 +65,8 @@ class ResendTicketEmailToCustomerController extends InternalApiController { $addressees = new Addressees(); $addressees->to = $ticket->email; - $emailSender->sendEmailForTicket(EmailTemplateRetriever::NEW_REPLY_BY_STAFF, $language, $addressees, $ticket, $hesk_settings, $modsForHeskSettings); + $emailSender->sendEmailForTicket($emailTemplate, $language, $addressees, $ticket, $hesk_settings, $modsForHeskSettings); + + http_response_code(204); } } \ No newline at end of file diff --git a/api/index.php b/api/index.php index 5c086a6b..52a815ee 100644 --- a/api/index.php +++ b/api/index.php @@ -142,6 +142,9 @@ function getLoggingLocation($exception) { $trace = $exception->getTrace(); $lastCall = $trace[0]; $location = basename($lastCall['file'], '.php'); + if ($location === null || trim($location) === '') { + $location = 'N/A'; + } return "REST API: {$location}"; } @@ -182,7 +185,7 @@ Link::all(array( /* Internal use only routes */ // Resend email response - '/v1/staff/tickets/{i}/resend-email' => \Controllers\Tickets\ResendTicketEmailToCustomerController::class, + '/v1-internal/staff/tickets/{i}/resend-email' => \Controllers\Tickets\ResendTicketEmailToCustomerController::class, // Any URL that doesn't match goes to the 404 handler '404' => 'handle404'