🥷

SMSTunnel for Ninja Forms

Ninja Forms SMS Action

Requires Ninja Forms • SMSTunnel Core Required

Coming to WordPress.org. Want it sooner? Write to us.

Description

SMSTunnel for Ninja Forms adds two SMS actions to the Ninja Forms builder: "SMSTunnel SMS" texts you when someone submits the form, and "SMSTunnel SMS (2) Autoresponder" texts them a confirmation. Include form field data using merge tags; the texts go out from your own phone and number.

Works with the free Ninja Forms plugin.

Features

  • Custom Action Type - Native integration with Ninja Forms actions
  • Field Merge Codes - Use {field:key} for one field, or {all_fields} for every field that was filled in
  • Works with All Fields - Text, email, phone and more; values from lists like checkboxes are joined with commas
  • Several Numbers - Separate numbers with commas; each number gets its own text
  • Autoresponder - SMSTunnel SMS (2) Autoresponder texts a confirmation to the person who filled in the form
  • Action Settings - Full settings panel in action drawer

Merge Codes

Include form field values in your SMS using merge codes:

{field:name} - Name field

{field:email} - Email field

{field:phone} - Phone field

{field:message} - Message/textarea field

{field:field_key} - Any field by its key

{all_fields} - All fields that were filled in

Field keys can be found in the field's administration settings.

Adding SMS Action

  1. Edit your form in Ninja Forms builder
  2. Click Emails & Actions
  3. Click the + button to add action
  4. Select SMSTunnel SMS (a text to you) or SMSTunnel SMS (2) Autoresponder (a text to the person who filled in the form)
  5. Fill in the phone number and message
  6. Save and publish the form

Example Setup

SMSTunnel SMS (to you):

Recipient Phone Number(s): your own number, like +14155550123

"New contact: {field:name} - {field:message}"

SMSTunnel SMS (2) Autoresponder (to the person):

Recipient Phone Number: {field:phone}

"Hi {field:name}, we got your message and will reply soon!"

Installation

  1. Install the SMSTunnel core plugin and link your phone: SMSTunnel → Quick Setup, then scan the QR code with the SMSTunnel app (Connections → Link with QR code)
  2. Make sure Ninja Forms is installed and active
  3. Add this add-on. It's coming to WordPress.org; once it's there, go to Plugins → Add Plugin, search for SMSTunnel Notifications for Ninja Forms, click Install Now, then Activate
  4. Edit any form → Emails & Actions → + → SMSTunnel SMS

Requirements

  • WordPress 5.0 or higher
  • PHP 7.4 or higher
  • Ninja Forms (installed and active)
  • SMSTunnel core plugin (installed and connected)

Changelog

1.0.2

  • The SMS actions now appear in the form builder under Emails & Actions (before, they were added too late)
  • A new SMS action has the Action Name and Active settings, and is switched on when you add it

1.0.1

  • Phone numbers are checked before sending; premium-rate numbers are skipped

1.0.0

  • Initial release

Build it with an AI assistant

Copy this prompt into Claude, ChatGPT, Cursor or Copilot and replace the part in [brackets]. Don't paste your API key into the chat: the prompt doesn't need it.

Help me set up SMSTunnel texts for my Ninja Forms forms in WordPress.

About SMSTunnel (https://smstunnel.io): my own apps and tools hand text messages (SMS) to my SMSTunnel account, and my own Android phone sends them from my own number, on my own SIM and plan. The phone runs the SMSTunnel app from Google Play (https://play.google.com/store/apps/details?id=io.smstunnel.app), signed in to my account.

What I want: [describe what should send a text, to whom, and when]

How it works:
- Plugins: SMSTunnel (core), the add-on "SMSTunnel Notifications for Ninja Forms" (coming to WordPress.org, not there yet; once it is: Plugins → Add Plugin → search for its name) and Ninja Forms.
- The SMSTunnel core plugin (https://wordpress.org/plugins/smstunnel/) links the site to my phone: SMSTunnel → Quick Setup, then I scan the QR code with the SMSTunnel app (Connections → Link with QR code) and approve on the phone. An API key works too: SMSTunnel → Settings → "Connect with API Key".
- Settings: edit the form → "Emails & Actions" → "+" → "SMSTunnel SMS" or "SMSTunnel SMS (2) Autoresponder". "SMSTunnel SMS": "Recipient Phone Number(s)" (several, separated by commas; merge tags like {field:phone}), "Message Body" (default "New form submission:", then {all_fields}). SMS (2): "Recipient Phone Number" (one number, like {field:phone}) and "Confirmation Message", a confirmation to the person who filled in the form.
- Tags: {field:KEY} (the field key) and {all_fields}.
- Numbers must start with + and the country code (spaces are fine). A local number with a leading 0 is skipped, one without + is read as if it began with a country code, and premium-rate numbers are always skipped. Each number gets its own text; texts are cut at 1600 characters. If my phone is offline, the texts wait and go out when it is back.
- For custom code, the core plugin has smstunnel_send_sms($phone, $message, $args = array()), with $args 'is_2fa' (sends through the sign-in code endpoint), 'order_id' and 'source'; it returns an array with 'success' and 'messageId', or 'error'. smstunnel_sanitize_recipient($phone) returns the number in international format, or '' when it is invalid or premium-rate.

Rules for your answer:
- Do not ask for my SMSTunnel password or API key and do not put a real key in your answer; I will not paste it in this chat.
- Phone numbers must be in international format (+ and the country code).
- Help me test it with my own number first.
- Only send texts people expect from me. No unsolicited texts.