Send Visitors to a Thank-You Page with Otter Blocks and AI
Point an Otter form at a thank-you page you can track as a lead, with a better message too.
Prerequisites
A site connected to WPVibe running Otter Blocks 3.2.8 or newer (tested on the free 3.2.8) on WordPress 6.9 or newer, with an administrator account, and forms built with Otter's Form block.
My site runs Otter Blocks. After someone sends the form on [the page your form is on], send them to a thank-you page called [thank-you page title, for example Thanks for your enquiry] that says [what happens next, for example we reply within one working day, and a link to our FAQ]. The message on the form itself should say [short message, or leave blank to keep the current one].
1. Run get_ability_info for each Otter ability this uses: otter/list-forms and otter/update-form. If one is not found, or run_wp_cli plugin list --status=active shows Otter older than 3.2.8, tell me Otter Blocks 3.2.8 or newer and WordPress 6.9 or newer are needed, and stop. MY_SITE below means my site's address. PAGE_TITLE and MESSAGE below mean the thank-you page title and the short message from my request above.
2. Find the form with otter/list-forms, per_page 50 (read every page), on the post whose post_title matches the page my form is on. If that post has more than one form, or several posts match, show them and ask which. Note form_id, post_id and the current redirect_link and submit_message (missing means none is set).
3. Create the thank-you page with rest_api_write POST /wp/v2/pages: title PAGE_TITLE, status draft, content in short paragraph blocks in my words. Show me its preview link and wait for my yes or my changes.
4. On my yes, run otter/update-form with form_id, post_id, dry_run true and delivery {"redirect_link": "THE_PAGE_LINK", "submit_message": "MESSAGE"}, where THE_PAGE_LINK is the page's link from step 3 without any preview parameters; leave submit_message out if I left the message blank (an empty string would remove the current one). Show me each setting's current and new value, and wait for my yes.
5. On my yes, publish the page with rest_api_write POST /wp/v2/pages/PAGE_ID with status publish only, check its published link matches THE_PAGE_LINK (use the published one if not), then run otter/update-form again with dry_run false. Read it back with otter/list-forms and the post_id and show me redirect_link. Tell me: if the page with this form is open in the block editor anywhere, reload it before saving it there. Saving that page in an editor opened before the change writes the old form settings back.
6. Ask me to fill in the form once and check I land on the thank-you page, and to look at my site's menu: on some block themes a menu with no pages chosen lists every published page, so the new page may show there; if it does, tell me to choose the menu's pages in Appearance > Editor > Navigation. To undo it, run otter/update-form with redirect_link "" (an empty string removes it) and submit_message set back to its old value from step 2 ("" if there was none), and offer to set the thank-you page back to draft.
Skip pasting the full prompt. Drop this into your AI on a site that already has WPVibe:
Run the “Send Visitors to a Thank-You Page with Otter Blocks and AI” recipe from the WPVibe cookbook on my connected site.
After someone sends your Otter form they see one line, “Success” unless you changed it. A thank-you page does more: it says what happens next, links to what they might need, and gives your analytics or ad platform a page to count as a lead.
The AI finds your form and creates the thank-you page as a draft with the words you give it. Once you like the page, it shows you the exact change to the form, and on your yes it publishes the page, points the form at it and sets the form’s short message too.
Name the form and what the page should say. Fill the form in once yourself afterwards to see it work: Otter shows the short message for about a second, then sends the visitor on. Keep the thank-you page out of your menus if you count its visits as leads.
Outcome
Visitors who send the form land on your published thank-you page.