Enquiries
Create enquiries using HTML forms or JavaScript, with enquiry and customer parameters.
Create enquiries using HTML forms or JavaScript, with enquiry and customer parameters. First, complete the installation.
Create enquiries
Use data-tiquo-form="enquiry" for a hosted website form. A signed-in visitor's
enquiry is attached to their own customer profile. Anonymous submissions use
the configured public key and allowed domain, and find or create a customer by
email. Submitting an enquiry does not sign the visitor in. Each form sends its
enquiries to one enquiry type, set with a hidden data-tiquo-enquiry="type"
input (see Associate a form with an enquiry type).
<form data-tiquo-form="enquiry">
<input type="email" data-tiquo-enquiry-customer="email" required />
<input type="hidden" data-tiquo-enquiry="type" value="YOUR_ENQUIRY_TYPE_ID" />
<input type="hidden" data-tiquo-enquiry="subject" value="Waitlist" />
<label>
Preferred event
<input data-tiquo-enquiry-parameter="ENQUIRY_TEXT_PARAMETER_ID" />
</label>
<label>
Need wheelchair access for this event
<input type="checkbox" data-tiquo-enquiry-parameter="ENQUIRY_BOOLEAN_PARAMETER_ID" />
</label>
<p data-tiquo-message></p>
<button type="submit">Send enquiry</button>
</form>Associate a form with an enquiry type
data-tiquo-form="enquiry" is always written exactly as shown. It only marks
the form as an enquiry form; it is not where the enquiry type ID goes. The
enquiry type comes from a hidden input inside the form:
<input type="hidden" data-tiquo-enquiry="type" value="YOUR_ENQUIRY_TYPE_ID" />To get the ID:
- Go to Settings > Enquiries.
- Open the ⋯ menu on the enquiry type and choose Copy enquiry type ID.
- Paste it as the hidden input's
value, replacingYOUR_ENQUIRY_TYPE_ID.
For example, a type named "Private Events" usually has the ID private_events:
<form data-tiquo-form="enquiry">
<input type="hidden" data-tiquo-enquiry="type" value="private_events" />
<!-- customer, subject, and parameter fields -->
</form>Every submission from that form is created under that type, so it appears in
that type's pipeline and uses its stages, enquiry parameters, and
auto-assignment. Without a type input, submissions go to the General
enquiry type (general). Renaming a type keeps its ID, so the form keeps
working. To collect several enquiry types, use one form per type, each with its
own type input.
To start from working code, choose Example form code in the same ⋯ menu.
It writes the form for that enquiry type, with its type ID and enquiry parameter
IDs filled in. Pick Hosted Package for this HTML form or a
window.Tiquo.createEnquiry() call, or DOM Package for JavaScript,
TypeScript, or a React component (see DOM Package enquiries). Switches beside the code add or remove each
customer field, enquiry field, and enquiry parameter, and Copy Code copies
the result.
Form fields and submission
Replace the parameter placeholders with that type's enquiry parameter IDs. To copy one, choose Edit Enquiry Type in the type's ⋯ menu under Settings > Enquiries, then open the ⋯ menu on the parameter and choose Copy enquiry parameter ID. A new parameter gets its ID once the enquiry type is saved. A field's ID must belong to the selected type and organisation. This attribute does not refer to customer parameters and cannot change customer preferences.
| Attribute | Purpose |
|---|---|
data-tiquo-form="enquiry" | Bind enquiry submission. Always the literal value enquiry, not an enquiry type ID |
data-tiquo-enquiry-customer | email (required), firstName, lastName, phone, or phoneCountry |
data-tiquo-enquiry | type (the ID from Copy enquiry type ID; defaults to general), subject, message, category, priority, or source |
data-tiquo-enquiry-parameter | Enquiry parameter ID, from Copy enquiry parameter ID in the parameter's ⋯ menu |
data-tiquo-enquiry-customer-parameter | Customer parameter schema ID; fills missing customer-editable profile values only |
data-tiquo-message | Submission feedback |
Supply at least subject or message. A single parameter checkbox sends a
boolean, a checkbox group sharing the same ID sends an array, and a multiple
select sends an array. Use a multiple select for a one-option multiselect.
Disabled fields are omitted. Forms emit tiquo:enquiry-created or
tiquo:enquiry-error, with the result/error in event.detail.
Anonymous enquiries are screened for spam and rate limited. A reserved test phone number or HTML in a name, subject, message, or answer is refused with "This enquiry could not be submitted.", which the form shows in data-tiquo-message and sends with tiquo:enquiry-error. An enquiry from a throwaway email address still succeeds for the visitor, but waits in the dashboard's spam list without creating a customer until staff mark it Not spam. See Spam screening and rate limits.
Use Tiquo's phone number field helper for the phone field so international phone numbers are formatted correctly: <input type="tel" data-tiquo-enquiry-customer="phone" data-tiquo-phone-field />. In Hosted Package 1.3.0 or newer, the enquiry then includes the normalized number and the selected country automatically. Custom phone inputs can use data-tiquo-enquiry-customer="phoneCountry" explicitly. Controls in disabled fieldsets, unchecked radios, and disabled options in multiple selects are omitted. See HTML form bindings for shared controls and events.
JavaScript submission
await window.Tiquo.createEnquiry({
customer: { email: 'guest@example.com' },
enquiry: {
type: 'YOUR_ENQUIRY_TYPE_ID',
subject: 'Waitlist',
enquiryParameterValues: [
{ enquiryParameterId: 'ENQUIRY_TEXT_PARAMETER_ID', value: 'Evening event' },
{ enquiryParameterId: 'ENQUIRY_BOOLEAN_PARAMETER_ID', value: false },
],
},
});Set enquiry.type to the ID from Copy enquiry type ID, as for the HTML form. The HTML binding builds this same payload. Names and contact fields only fill missing customer data. Customer parameter IDs cannot be used as enquiry parameter IDs. The enquiry answer request names remain enquiryParameterValues and enquiryParameterId.
- Customer parameters can be initialized through
customer.customerParameterValuesonly when no stored value exists and the parameter is customer editable. - Existing rows are never overwritten, even when the stored value is empty, false, or a system default. This applies to guests and authenticated enquiry submissions.
customer.detailsremains supported as a legacy object keyed by customer parameter ID, name, or normalized key.- Explicit array entries are processed first; the first non-empty value for a missing schema wins.
- Null, empty text, and empty arrays are ignored. Invalid or non-editable parameters reject the whole submission.
Marketing/SMS Opt-In defaults count as existing values, so this route cannot change their seeded false values. Use subscribeToMarketing() to enable checked email/SMS opt-ins without login. Use an authenticated profile form or the server-side Admin API for other preference changes, including opting out. Customer parameter values are saved on the profile, not included in the enquiry.created event payload.
await window.Tiquo.createEnquiry({
customer: {
email: 'guest@example.com',
customerParameterValues: [
{ customerParameterId: 'YOUR_CUSTOMER_PARAMETER_ID', value: 'Example Ltd' },
],
// Legacy alternative: details: { YOUR_CUSTOMER_PARAMETER_ID: 'Example Ltd' }
},
enquiry: { type: 'YOUR_ENQUIRY_TYPE_ID', subject: 'Waitlist' },
});Use a customer parameter schema ID for customerParameterId, not an enquiry parameter ID. Values accept strings, finite numbers, booleans, null, or string arrays (for multiselects). At most 100 entries across both fields and 10,000 serialized characters per value are accepted. Enquiry answers remain separate under enquiry.enquiryParameterValues with enquiryParameterId.
For a hosted HTML enquiry form, add a customer parameter input:
<input data-tiquo-enquiry-customer-parameter="YOUR_CUSTOMER_PARAMETER_ID" />This produces customer.customerParameterValues. Single checkboxes send booleans, checkbox groups send arrays, and disabled fields are omitted.
Enquiry parameter values are validated and stored only on the new enquiry. Invalid schema IDs or
options reject the whole submission. A parameter left blank, such as a dropdown
still on its empty Choose… option or an empty date, is skipped instead, so
optional fields can stay empty. The event carries normalized strings under
enquiryParameters.<enquiryParameterId>. See Enquiry Parameters
for value types, limits, and event behaviour.