Webové formuláře¶
Servisní formulář¶
integration:
name: "ServiceRequestForm"
type: "webform"
endpoint: "/forms/service-request"
fields:
- name: "company"
type: "text"
label: "Název společnosti"
required: true
- name: "contact"
type: "text"
label: "Kontaktní osoba"
required: true
- name: "phone"
type: "tel"
label: "Telefon"
required: true
- name: "email"
type: "email"
label: "E-mail"
required: true
- name: "address"
type: "text"
label: "Adresa provozovny"
required: true
- name: "description"
type: "textarea"
label: "Popis závady"
required: true
- name: "photos"
type: "file"
label: "Fotografie"
accept: "image/*"
multiple: true
maxSize: 10485760 # 10 MB
processing:
# Najít nebo vytvořit organizaci
- action: "findOrCreateEntity"
entity: "Account"
match:
name: "{company}"
create:
name: "{company}"
type: "Customer"
# Najít nebo vytvořit kontakt
- action: "findOrCreateEntity"
entity: "Contact"
match:
emailAddress: "{email}"
create:
firstName: "{contact.split(' ')[0]}"
lastName: "{contact.split(' ').slice(1).join(' ')}"
emailAddress: "{email}"
phoneNumber: "{phone}"
accountId: "{account.id}"
# Vytvořit Lead
- action: "createEntity"
entity: "Lead"
data:
name: "Webový formulář - {company}"
source: "WebForm"
type: "Service"
description: "{description}"
accountId: "{account.id}"
contactId: "{contact.id}"
attachments: "{photos}"
# Notifikace
- action: "notify"
to: "role:Dispatcher"
template: "new_web_request"
response:
success:
redirect: "/thank-you"
message: "Děkujeme, Váš požadavek byl přijat."
Typy polí¶
| Typ | Popis |
|---|---|
text |
Textové pole |
textarea |
Víceřádkové pole |
email |
E-mail s validací |
tel |
Telefonní číslo |
file |
Upload souborů |
select |
Výběr z možností |
checkbox |
Zaškrtávací pole |
➡️ Pokračujte na Bezpečnost.