Resend email endpoint appears to be working...need to do further tests first though
This commit is contained in:
parent
69676232e3
commit
7c144df494
@ -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);
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
@ -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'
|
||||
|
Loading…
x
Reference in New Issue
Block a user