Skip to content

Commit

Permalink
Autoresponse notification fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
EvolutionPHP committed Mar 11, 2021
1 parent e4c259f commit 28559d8
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 3 deletions.
1 change: 1 addition & 0 deletions hdz/app/Controllers/Ticket.php
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,7 @@ public function clientShow($ticket_id, $page=1)
}

$tickets->staffNotification($info);
$tickets->autoResponseNotification($info);
$this->session->setFlashdata('form_success',lang('Client.viewTickets.replySent'));
return redirect()->to(current_url());
}
Expand Down
1 change: 0 additions & 1 deletion hdz/app/Language/en/Admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
'editDepartment' => 'Edit department',
'newDepartment' => 'New department',
'departmentCreated' => 'New department has been created.',

'notes' => 'Notes',
'notesRemoveConfirmation' => 'Do you really want to remove this note?',
'invalidRequest' => 'Invalid request.',
Expand Down
1 change: 1 addition & 0 deletions hdz/app/Libraries/MailFetcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ public function parseToTicket($clientName, $clientEmail, $subject, $body, $depar
$ticket_id = $ticket->id;
$message_id = $tickets->addMessage($ticket_id, $body, 0, false);
$tickets->updateTicketReply($ticket_id, $ticket->status);
$tickets->autoResponseNotification($ticket);

This comment has been minimized.

Copy link
@yhonaqc

yhonaqc Mar 11, 2021

The reply should be in the first message

}
$tickets->staffNotification($ticket);
return [$ticket_id,$message_id];
Expand Down
19 changes: 17 additions & 2 deletions hdz/app/Libraries/Tickets.php
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ public function staffNotification($ticket)
'%ticket_id%' => $ticket->id,
'%ticket_subject%' => $ticket->subject,
'%ticket_department%' => $ticket->department_name,
'%ticket_status%' => lang('open'),
'%ticket_status%' => lang('Admin.form.open'),
'%ticket_priority%' => $ticket->priority_name,
],$item->email, $ticket->department_id);
}
Expand Down Expand Up @@ -375,12 +375,27 @@ public function replyTicketNotification($ticket, $message, $attachments=null)
'%ticket_id%' => $ticket->id,
'%ticket_subject%' => $ticket->subject,
'%ticket_department%' => $ticket->department_name,
'%ticket_status%' => $this->statusName($ticket->status),
'%ticket_status%' => lang('Admin.form.'.$this->statusName($ticket->status)),
'%ticket_priority%' => $ticket->priority_name,
'%message%' => $message,
], $ticket->email, $ticket->department_id, $files);
}

public function autoResponseNotification($ticket)
{
//Send Mail to client
$emails = new Emails();
$emails->sendFromTemplate('autoresponse', [
'%client_name%' => $ticket->fullname,
'%client_email%' => $ticket->email,
'%ticket_id%' => $ticket->id,
'%ticket_subject%' => $ticket->subject,
'%ticket_department%' => $ticket->department_name,
'%ticket_status%' => lang('Client.form.'.$this->statusName($ticket->status)),
'%ticket_priority%' => $ticket->priority_name,
], $ticket->email, $ticket->department_id);
}

/*
* -----------------------------
* Get Messages
Expand Down

0 comments on commit 28559d8

Please sign in to comment.