Skip to main content
Version: Latest
Technical ManualLooking for step-by-step instructions? In the User Manual: Let Customers Open Requests on the SitePut a Request Form on a Page

Portal and web form

Portal​

The Tickets Portal feature (CrestApps.OrchardCore.Tickets.Portal) adds a Requests page to the site's My account area:

  • account/requests lists the signed-in person's requests, newest first, with the status as customers see it. An administrator of an account (an account member with the Admin role) also gets a tab with the account's requests.
  • account/requests/new offers the ticket types whose Ticket part settings say Customers can submit it, with their description for customers, on the desks that serve customers (and, with Staff on, the internal desks for a person who is a member of staff, so employees file IT and HR requests from the same catalog); then the type's own form: its title (the subject) and only the fields whose settings say Customers fill this in (TicketFieldCustomerSettings, off by default), then the description and files. Other parts and fields are hidden while the form is built (TicketCustomerPlacementProvider) and put back as a new item has them after it is read (TicketCustomerEditor), so an internal field on a type customers submit can't be set by posting it. The ticket opens with the Portal channel and the person as its requester.
  • account/requests/{number} shows the public replies, oldest first, with download links for their files that work for an hour, and a reply box. Internal notes and the record of changes never show. A reply from the requester reopens a solved request as a reply on an agent's page would.
  • A requester without a login opens requests/{id}?token=…, the signed link in their e-mails (90 days), to read and answer that one request. The link is bound to the ticket, its requester (their user, or their e-mail address) and a version (TicketPart.AccessVersion): a new requester, a merge or an erasure leaves every earlier link dead. On first use the token is traded for an HttpOnly cookie scoped to that request's path (12 hours) and the page reloads without it, so it leaves the address bar, history and logs. Rating links work the same way.
  • Every portal page is sent with Cache-Control: no-store, Referrer-Policy: no-referrer and X-Robots-Tag: noindex. Outcomes (received, reply sent, rating saved, or why not) are written on the page itself, and a refused reply keeps its text, since a site's theme may not show notifications.
  • What shows: a ticket on a desk that serves customers to its requester and the administrators of its account; a ticket on an internal desk only to its requester, when they are staff, never through an account. A member of an account (any role) files new requests on customer desks under the account. Requester e-mail links are built from the site's Base URL only; without one they are left out and a warning is logged.
  • Limits (through Orchard Core's Rate Limits, which the portal turns on): 10 new requests and 30 replies or ratings per signed-in requester in 10 minutes, and 10 guest replies or ratings per address (groups tickets-portal-create, tickets-portal-reply, tickets-portal-guest); 20 portal replies per request an hour; uploads within the attachment limits (checked before a file is read, and a 210 MB request cap). The thread shows the original request and the latest 200 messages, and below it the request's files (the files of its public messages and of the requests of the same requester merged into it), by links signed for an hour.

What requesters share as protected information on these forms is described in Protected information.

Ratings​

Once a request is solved, its requester rates it from 1 to 5 with an optional comment, on the request's page in My account or from the ticket-rating e-mail. A desk's Ask requesters to rate a solved ticket after (hours) (TicketDesk.RatingRequestDelayHours, 0 never asks) sends that e-mail once, through the outbox, to the requester of a ticket solved that long ago and no more than a week before (so turning it on doesn't e-mail every old ticket); its link is signed and works for 30 days (requests/{id}/rate), and in its template Ticket.Link is the rating page. ITicketService.RateAsync keeps one rating per ticket (a second replaces it) on TicketPart.Satisfaction, the index (SatisfactionScore), the timeline ("Rated 4 out of 5.") and tells observers (ITicketObserver.RatedAsync): the Ticket Rated workflow event (Score, Comment) and the SatisfactionScore and SatisfactionComment fields of the Tickets data set.

Every requester e-mail ends with View your request, linking to the request in My account, or to the signed link for a guest (TicketEmailModel.Link for templates, ITicketRequesterLinks for code). Links use the site's Base URL when it is set. Desk permissions play no part in the portal: a person sees what they asked for, and an account administrator what their account asked for.

Web form​

The Ticket Web Form feature (CrestApps.OrchardCore.Tickets.WebForm) adds a Ticket Form widget (TicketFormWidget, with TicketFormPart): choose the ticket type and the desk, and optionally what the visitor reads once it's sent. Place it like any widget (layers, flow). It asks for the request, a category when the type has categories (only those customers may choose), the questions of the ticket type that customers fill (the same editor as the portal's, with the type's show-when rules), a subject unless the type has a title of its own (the title is the subject then), and a name and an e-mail when the visitor isn't signed in; a signed-in visitor is the requester. As on the portal, the answers are checked again on the server: only customer fields are kept, a hidden question keeps nothing, a required question that is showing must be answered, and the widget's desk is a suggestion the category's desk may take over (DeskIsSuggestion). The form posts to tickets/forms/{widgetId} and the ticket opens with the WebForm channel; the visitor goes back to the page, which says it was received with its number, or what went wrong.

Robots are kept out several ways: a hidden trap field (a filled one is answered as if it worked and opens nothing); through Orchard Core's Rate Limits (the feature turns it on), 10 submissions per visitor in 10 minutes across nodes (rate-limit group tickets-web-form, per signed-in user, otherwise per address; behind a proxy, set up Reverse Proxy so the address is the visitor's); at most 5 per address in 10 minutes on each node as a last line (TicketFormGuard, in memory); and, with ReCaptcha on and its keys set, a challenge every guest must pass, checked on the server (ITicketFormChallenge). The widget's editor warns when no challenge is set up. A form posts only while its widget is published and the visitor may view it; the post is at most 64 KB, a guest's name at most 200 characters, the subject is cut at 200 and the request at 10,000.

A guest's address is unconfirmed. A guest can type anyone's e-mail, so a guest's ticket is marked RequesterUnverified (TicketCreateRequest.RequesterUnverified): it is never filed under an account by the address's domain, and every e-mail to that address carries only fixed text and the ticket's number, never the guest's subject, name or a link to a page showing them (templates get Ticket.Subject, Ticket.RequesterName and Ticket.Link empty). An agent's own replies still reach the guest. The site can't be used to send someone else's words to any address.