📝

SMSTunnel for Contact Form 7

CF7 SMS Notifications

Free on WordPress.org • Requires Contact Form 7 • SMSTunnel Core Required

Description

SMSTunnel for Contact Form 7 integrates SMS notifications with the popular Contact Form 7 plugin. Get an SMS when a form is submitted and send a confirmation text to the person who filled it in.

The texts are sent by your own Android phone, from your own number. Handy for new leads, appointment requests and contact inquiries.

Features

  • Form Submission Alerts - Get an SMS each time someone submits the form and it passes CF7's checks
  • Auto-Reply to Submitter - SMS (2) sends a confirmation text to the number in the form's [your-phone] field (change the tag if your phone field has another name)
  • Use Form Fields - Include any form field value in your SMS
  • Per-Form Settings - Configure different SMS settings for each form
  • Several Recipients - Separate numbers with commas; each number gets its own text
  • International Numbers - Numbers must start with + and the country code (spaces are fine). One without + is read as if it began with a country code, and local numbers starting with 0 and premium-rate numbers are skipped, so ask for international format in your form

How to Use Form Fields

Use CF7 mail-tags in your SMS template to include form field values:

[your-name] - Name field

[your-email] - Email field

[your-phone] - Phone field

[your-message] - Message field

[your-subject] - Subject field

[_date] [_time] - Submission date and time

[_remote_ip] - Visitor's IP address

[_site_title] [_site_url] - Your site's title and address

[_post_title] [_post_url] - Page the form was sent from

The field names depend on your CF7 form configuration. Other special mail-tags are not replaced.

Example Setup

Admin Notification:

"New contact from [your-name]: [your-message] - Reply to: [your-phone]"

Auto-Reply to Submitter:

"Hi [your-name], thanks for contacting us! We'll get back to you within 24 hours."

When the text to you goes out, the form's response message also says "Your SMS has been sent successfully." (and shows as sent even if the email failed).

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) and approve on your phone
  2. Ensure Contact Form 7 is installed and active
  3. In WordPress, go to Plugins → Add Plugin and search for SMSTunnel for CF7
  4. Click Install Now, then Activate
  5. Go to Contact → Contact Forms, edit a form and open its SMS tab (shown to administrators)

Requirements

  • WordPress 5.0 or higher
  • PHP 7.4 or higher
  • Contact Form 7, installed and active
  • SMSTunnel core plugin, linked to your phone
  • The SMSTunnel app on your Android phone, from Google Play

Screenshots

Changelog

The current version and its full changelog are on the plugin's WordPress.org page.

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 Contact Form 7 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), "SMSTunnel for CF7" (https://wordpress.org/plugins/smstunnel-for-cf7/) and Contact Form 7.
- 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: Contact → Contact Forms → edit the form → tab "SMS" (shown to administrators). SMS (1): "Send SMS notification when this form is submitted", "Recipient Phone Number(s)" (several, separated by commas), "Message Body" (default "New form submission:\nName: [your-name]\nEmail: [your-email]\nMessage: [your-message]"). SMS (2): "Use SMS (2)", "Recipient Phone Number" (default [your-phone], the visitor's own field) and its "Message Body": a confirmation to the person who filled in the form.
- Tags: any field of the form, like [your-name] or [your-phone], plus [_date], [_time], [_remote_ip], [_site_title], [_site_url], [_post_title], [_post_url]. Other mail-tags are not replaced. The texts go out on every valid submission.
- 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.