Skip to main content
Cookbook Marketing Ninja Forms

Send an Automatic Reply from Your Form with Ninja Forms and AI

Everyone who fills in your form gets a reply at once that thanks them, repeats what they picked and says what happens next.

Difficulty Beginner
Time ~5 min

Prerequisites

A site connected to WPVibe running Ninja Forms 3.15.6 or newer (tested on the free 3.15.6) on WordPress 6.9 or newer, with an administrator account. A form with an email field.

The prompt
My site runs Ninja Forms. Add an automatic reply to my form [form name] that goes to the person who filled it in. It should thank them, repeat [which answers, for example the villa and the trip type], and say [what happens next, for example we reply within one working day]. Replies to it should come to [my email address]. Sign it [your business name].

From my request take MY_EMAIL.

1. Run run_wp_cli with plugin get ninja-forms; if its version is below 3.15.6, tell me to update Ninja Forms and stop. Then run get_ability_info for each Ninja Forms ability this uses: ninjaforms/list-forms, ninjaforms/get-form, ninjaforms/list-actions, ninjaforms/add-action, ninjaforms/update-action. If one is not found, tell me and stop.
2. Run ninjaforms/list-forms and find the form. If several match, show me their titles and ask.
3. Run ninjaforms/get-form. Find the email field (type email) and call its key EMAIL_KEY; if there is none, stop and tell me the form needs one. Find the name field (type firstname, or a textbox labelled name) and call its key NAME_KEY. Sort the answers I want repeated into picked answers (listselect, listradio, listcheckbox: Ninja Forms only accepts choices from the form's own list) and typed answers (everything else, dates, numbers and the name included: a bot posting straight to the site can put any words in them).
4. Spam check: look in get-form for a recaptcha, hcaptcha or turnstile field, or an action of type recaptcha that is on (active 1; reCAPTCHA v3 is added as an action, not a field, and does nothing while off). For each one found, run run_wp_cli with option pluck ninja_forms_settings and the site key's name (recaptcha_site_key or recaptcha_site_key_3, hcaptcha_site_key, turnstile_site_key); an empty result or an error means not set. Say only set or not set; never print a key, and do not use ninjaforms/get-plugin-settings, which returns the secret keys too. Ninja Forms also adds a hidden honeypot field to every form, but it is checked only in the visitor's browser, so bots that post straight to the site skip it.
   With a captcha (a field, or that action switched on) and its key set, the reply may use typed answers (name, dates, numbers) as well as picked ones. Without one, use picked answers only, open with Hi there, and tell me which answers you left out and why: the reply goes to whatever address is typed, so typed words would let a bot send its own message through my site. Ask whether to go ahead.
5. Run ninjaforms/list-actions. Look for email actions whose to is {field:EMAIL_KEY} or another field merge tag. Tell me their labels, subjects and whether each is on, and say their message can't be read through these abilities; Ninja Forms' own Contact Me form ships with one (Email Confirmation) that sends every answer back, typed ones included. Each one may also have settings these abilities can't read (cc, bcc) or change (an attached CSV of every answer), so never reuse one: after my yes in step 6, switch each of them off with ninjaforms/update-action (form_id, its action_id, active 0) and add the new reply. Never leave an old reply on beside the new one.
6. Write the reply: a subject with no merge tags in it, and a short message in simple HTML paragraphs with {field:KEY:label} for picked answers (plain {field:KEY} prints the stored value, such as tulum, not the label Tulum) and, only when step 4 allows it, {field:KEY} for typed ones. No spaces are needed around merge tags in emails: write Hi {field:NAME_KEY}, directly. Show me the subject and message with example answers filled in and wait for my yes.
7. Switch off the old replies from step 5, then run ninjaforms/add-action with form_id, type email, label Auto-reply, to {field:EMAIL_KEY}, subject, message, email_format html and reply_to MY_EMAIL (Ninja Forms accepts reply_to and email_format here although the schema leaves them out).
8. Run ninjaforms/list-actions and confirm the new reply is on and no other reply to {field:EMAIL_KEY} is. Tell me to fill in the form myself with my own address to see it.
Already connected?

Skip pasting the full prompt. Drop this into your AI on a site that already has WPVibe:

Run the “Send an Automatic Reply from Your Form with Ninja Forms and AI” recipe from the WPVibe cookbook on my connected site.

Someone fills in your form and hears nothing. They don’t know if it went through, so they send it again or ask someone else. A short reply that arrives at once, repeating what they picked, tells them you have it and what happens next.

The AI reads your form to find the email field and the choices worth repeating, checks the form’s spam protection and any reply it already sends, writes the email for you to approve, and adds it as a Ninja Forms email action. Replies to it come back to the address you choose. Without a captcha it repeats only answers picked from your own lists, never anything typed (names, dates and numbers included), so a bot can’t use your form to send its own words to someone else.

Say which form and what the reply should promise. It starts with the next submission, so fill the form in yourself to see it. If the test never arrives, the problem is usually that your site cannot send mail at all, which a mailer plugin fixes.

Outcome

The form emails each person who fills it in a reply that thanks them, repeats their choices and sends replies back to you.