I've got a work-around for an annoying issue I've had in 1.18.2 and wanted to share it incase it could help anyone else.
My problem: All email processes work, EXCEPT if I only have one recipient - ex: the person who sent in the email and opened the ticket, and we are replying to the ticket. The email will not be sent after we reply via the web interface. It's a bug.
I also noticed that if there is 1 or more collaborators, the default reply-to "All Active Recipients" works just fine, and emails go through.
If I select reply to: Ticket Owner it works fine if there are no collaborators that need to be added.
Here is the work-around until someone patches this for real.
My code checks if there are more than 0 collaborators, if so, it defaults to "All Active Recipients" and works fine because there's 1 or more collaborators.
If there are 0 collaborators, it changes the default selection to Ticket Owner, which works when there is only one person in the chain.
So it toggles to the right option based on the ticket's number of collaborators, in order to work-around the problem.
The code:
osticket/include/staff/ticket-view.inc.php
line 985 replace this:
$replyTo = $_POST['reply-to'] ?: 'all';
with this:
// Get the reply-to value from the form submission.
$replyTo = $_POST['reply-to'];
// If no form value is submitted, determine the default.
if (!$replyTo) {
// Check if the ticket has any collaborators.
if ($ticket->getCollaborators()->count() > 0) {
$replyTo = 'all'; // Default to 'all' if there are collaborators.
} else {
$replyTo = 'user'; // Default to 'user' if there are no collaborators.
}
}