3 Commits

Author SHA1 Message Date
johnnyq
6e03857c6c Show whether each ticket reply was emailed and who to: replies are marked Email reply, Public note or Internal, an email reply lists each recipient with their email's state from the mail queue (sent, waiting, retrying, failed with why, cancelled) and a Mail Queue link for admins, sending says how many it went to or why it didn't go, and editing an emailed reply says the client keeps what was sent; database 3.4.8 adds ticket_replies.ticket_reply_emailed and ticket_reply_emailed_to and email_queue.email_ticket_reply_id, matching the mail queue's update and resolved emails to their replies; bulk reply, bulk resolve and the API record it too 2026-10-26 12:51:28 -04:00
johnnyq
36ea4a9a80 API: allow reads to filter by client_id on top of RBAC client scoping
The RBAC rework dropped the client_id read filter along with per-key client scope, so an all-clients key could no longer narrow to one client. apiClientScopeSql() now appends the filter after the scope fragment, so it can only narrow, never widen. Reads only - writes take client_id as their target client.
2026-08-31 18:30:09 -04:00
johnnyq
e76b384606 Add ticket reply API endpoints
GET /api/v1/ticket_replies/read.php and POST create.php, so an RMM or
monitoring system can append to a ticket it did not open.

Replies default to Internal so an integration cannot email a client by
omitting a parameter. Public replies mark first response, notify the
contact and watchers, and fire the same custom actions as the agent
reply handler. An optional ticket_status also sets the status, and
resolves the ticket and marks the resolution SLA when set to 4.

Replies are always joined to tickets so ticket_client_id is checked
against the key user's client scope, and the client_id named on a write
must match the ticket's own client. The reply is attributed to the user
the API key runs as.

read.php resolves ticket_reply_by_name, since that column holds a
user_id on Internal and Public replies but a contact_id on Client ones.
2026-07-29 01:53:18 -04:00