Processes contact-us form submissions into persisted ContactRequest records: matches the submitting profile to an existing account or creates one, files the request into an appropriate group, stores any attachments, and triggers the notification and funnel events that follow a submission. Registered as the "contactFormService" application service. Most operations are also exposed through ContactUsApp, which is the facade app code normally calls.
Group: Managers
Properties
| Property | Returns | Description |
|---|---|---|
| fieldNames | Set<String> | Custom field names that have been recorded against contact requests for the current admin organisation, cached for five minutes. Returns null if the lookup failed. |
Methods
getFieldNames()
Returns: Set<String>
Custom field names that have been recorded against contact requests for the current admin organisation, cached for five minutes. Returns null if the lookup failed.
processContactRequest(CommonResource page, Map<String,String> parameters, Map<String,FileItem> files)
Returns: ContactRequest
Convenience wrapper that resolves the website from the given page and the current Hibernate session, then delegates to the full processContactRequest. Wraps any checked exception in a RuntimeException.
| Parameter | Description |
|---|---|
page | the resource within the website that the submission came from |
parameters | the submitted form parameters |
files | the submitted file attachments, keyed by field name |
loadFormDetails(CommonResource page, Path contactForm)
Returns: Map<String,String>
Reads the "data/parameter" script tags declared in a contact form's html page, used to configure how a submission on that form is processed. See the constants on SendContactMailProcessable for the parameter names understood. Returns null if the page could not be found, is not a renderable html resource, or could not be accessed.
| Parameter | Description |
|---|---|
page | a resource used to resolve the website the form lives in |
contactForm | the path, within the website, of the html page containing the form |
findContactForm(CommonResource page, Path contactForm)
Returns: Resource
Resolves the html resource for a contact form path within the given page's website, caching the result on the current request so repeated lookups during the same submission are cheap. Returns null if the form path is null, the website's root folder is not a WebsiteRootFolder, or the path cannot be found.
| Parameter | Description |
|---|---|
page | a resource used to resolve the website the form lives in |
contactForm | the path, within the website, of the html page containing the form |
findByField(String fieldName, String fieldValue)
Returns: List<ContactRequest>
Finds contact requests, in the current admin organisation, that have a custom field matching the given name and value. Used to look up submissions by an arbitrary custom form field rather than a built-in property.
| Parameter | Description |
|---|---|
fieldName | the custom field name to match |
fieldValue | the custom field value to match |
getContactRequest(long crId)
Returns: ContactRequest
Loads a contact request by its database id, scoped to the current admin organisation. Returns null if no such contact request exists, or if it belongs to a website in a different organisation.
| Parameter | Description |
|---|---|
crId | the contact request's database id |
deleteContactRequest(ContactRequest contactRequest)
Returns: void
Deletes a contact request and fires the search-index update event that removes it from the index. The request must belong to a website in the current admin organisation.
| Parameter | Description |
|---|---|
contactRequest | the contact request to delete |