Recovering unfinished forms
Code: includes/modules/forms/class-builder-os-forms-abandon.php; public JS public/js/builder-os-forms-abandon.js. Off by default, per form and per wizard; when off, no JS is loaded and no notice is shown.
- Settings (option
builder_os_forms):abandon(bool),abandon_note(editable privacy notice; by default “If you don’t finish, we save your email or phone so we can help you. You can ask us to delete it.”) andabandon_crm(bool, “Create contact in the CRM”). In the wizard:graph.abandon = { on, note, crm }(switch in its general settings). Global (Home → Forms):abandon_minutes(1 to 1440, default 30). - Page: per request (uncached)
Builder_OS_Forms::finalize()adds<input name="_bos_ab">anddata-bos-abandon-note. The JS waits for a valid email, phone or name, 1.5 s after the last keystroke, and sends withnavigator.sendBeacononfocusout,visibilitychangeandpagehide. With a full page cache you must flush it when you change the setting. - Data: private content type
bos_form_partial(outside thebos_submissionqueries). Metadata:_bos_form_key,_bos_form_id,_bos_form_name,_bos_ab_kind,_bos_email,_bos_phone,_bos_ab_name,_bos_ab_reached,_bos_ab_step,_bos_ab_last,_bos_ab_token(hash),_bos_ab_crm,_bos_ab_fired,_bos_crm_contact. Never free text, option answers, IP or user agent. The visit token lives in the browser’s memory (it isn’t a cookie) and only its hash is stored on the server. - Retention: 30 days with no activity; the queue (
forms.abandon_purge) deletes it daily. A real submission with the same token, email or phone deletes it instantly. Exporter and eraser in WordPress’s privacy tools (“Unfinished forms (BuilderOS)”), suggested privacy policy text and deletion on uninstall. - Public REST:
POST /builder-os/v1/forms/abandon({ schema, sig, rt, token, fields, reached, bos_website, page, lang }; checks signed schema 400, per-IP limit 429 with thebuilder_os_forms_abandon_rate_limitfilter [40 per 10 min], honeypot, time token, setting on, visit token and valid email or phone; otherwise,200 {ok, stored}). In wizards,POST /wizard/<id>/partialwith the same rules and only with the setting on. - Messages inbox (
GET /builder-os/v1/forms/inbox):status=abandonedlists the partials (“Unfinished” folder; they don’t count towardtotal,unreadorformsof/forms/inbox/counts, which addsabandoned). Each item carrieskind(form|wizard),step,reached,summaryandcontact({mailto, whatsapp, tel});deleteortrashdeletes it (no trash). The detail addsmeta.recovery,crm_contact_idandcrm_url. - CRM: with
abandon_crmand afterabandon_minutes(filterbuilder_os_forms_abandon_minutes) the contact is created with originform-abandoned, without marketing consent, and theform_abandonedtrigger is emitted once (form_id,form_key,form_name,step,partial_id). Theabandoned_formtemplate sends a marketing email only to someone who’s subscribed; otherwise, it creates the task “Call {{nombre}}: left a form unfinished.” - MCP:
forms_list_abandoned(read-only, “Forms with AI” group;limit1 to 50,form_id):{ total, abandoned:[{ id, form, step, last_activity, email, phone }] }, with no name or free text; Messages permission. - For the AI (chapter 25): it’s optional and off; don’t turn it on unless the user asks, keep the privacy notice visible, don’t ask for or save anything beyond name, email or phone, don’t turn on “Create contact in the CRM” unless asked, and never write to someone without consent: create a call task. To read them use
forms_list_abandoned.