Automatic SMS Reply From a QR Code Using Google Voice + Gmail
(No Paid SMS Tools)

Why build this

If you run a local campaign (flyer, card, poster, door hanger), you want people to contact you instantly—without installing an app and without paying for an SMS platform.

This setup lets you:

· Turn a QR scan into a text-message lead

· Reply automatically with a link (coupon, form, booking page, audit offer)

· Keep it free/low-cost using tools many people already have (Google Voice + Gmail)

· Track and standardize inbound leads (same reply every time)

What it does (simple)

1. Customer scans a QR code.

2. Their phone opens the native SMS app with a pre-filled message.

3. They tap Send → the message goes to your Google Voice number.

4. Google Voice forwards that SMS to your Gmail inbox as an email.

5. A Google Apps Script detects that email and replies to Google Voice’s special “text tunnel” address.

6. That email is converted into an SMS reply back to the customer—automatically—with your link.

What you need

· A Google Voice number

· A Gmail inbox that receives Google Voice forwarded texts (example: brand360pros@gmail.com)

· A webpage link you want to send back automatically (example: your hidden form page)

· About 10 minutes for one-time setup

Step-by-step setup

Step 1 — Create your SMS QR code

Create a QR code that opens a text message to your Google Voice number with a pre-filled message.

Example pre-filled message:

“I’d like the $99 credit link.”

Tip: Any QR generator that supports sms: links works.

Step 2 — Turn on Google Voice SMS forwarding to Gmail

In Google Voice settings: enable forwarding of text messages to your Gmail address (the same Google account).

This is critical: the automation works by reading those forwarded emails.

Step 3 — Create two Gmail labels

In Gmail, create these labels exactly (spelling matters):

· AutoReplyNeeded

· AutoReplied

These labels control automation and prevent duplicate replies.

Step 4 — Create a Gmail filter (routes only Voice texts into the pipeline)

Create a Gmail filter with:

· From: @txt.voice.google.com

· Action: Apply label → AutoReplyNeeded

· Optional: Never send it to Spam

This ensures only Google Voice forwarded SMS emails enter the auto-reply workflow.

Step 5 — Create the Google Apps Script (the automation engine)

Go to script.google.com and create a new project named: GV_AutoReply

Paste this script (ASCII-safe version):

const LABEL_NEED = 'AutoReplyNeeded';

const LABEL_DONE = 'AutoReplied';

const FORM_LINK = 'https://brand360pro.com/customer-info-form';

function buildReplyBody_() {

return (

"Thanks for reaching out.\n" +

"Here is a quick page to help apply the $99 credit:\n" +

FORM_LINK);}

function runAutoReply() {

const need = GmailApp.getUserLabelByName(LABEL_NEED);

const done = GmailApp.getUserLabelByName(LABEL_DONE);

if (!need || !done) return;

const threads = need.getThreads(0, 20);

for (const thread of threads) {

// Skip if already processed

if (thread.getLabels().some(l => l.getName() === LABEL_DONE)) {

need.removeFromThread(thread);

continue;}

const messages = thread.getMessages();

const lastMsg = messages[messages.length - 1];

// Google Voice "tunnel" reply address

const replyRaw = lastMsg.getReplyTo() || lastMsg.getFrom() || '';

const match = replyRaw.match(/[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}/i);

if (!match) continue;

GmailApp.sendEmail(

match[0], // send to @txt.voice.google.com address

'', // subject can be blank

buildReplyBody_());

// Mark done

done.addToThread(thread);

need.removeFromThread(thread);}}

Important:

· You must be logged into the same Google account that receives the SMS emails and owns the Voice number.

· Avoid emojis and “smart quotes” inside the script (they can cause syntax errors).

Step 6 — Authorize the script (one-time)

In Apps Script:

7. Select function: runAutoReply

8. Click Run

9. Approve permissions

If you see “Google hasn’t verified this app,” that’s normal for personal scripts:

10. Click Advanced

11. Click Go to project (unsafe)

12. Click Allow

Step 7 — Add a trigger (run every minute)

In Apps Script → Triggers:

· Add trigger for function: runAutoReply

· Event source: Time-driven

· Schedule: Every 1 minute

· Save

If you ever see “Bad Request (Error 400)” while saving a trigger, reload the project and try again. Check the Triggers list to confirm it exists.

Step 8 — Test end-to-end

Use a phone that is NOT your Google Voice number:

13. Scan the QR code

14. Send the pre-filled text

15. Within 1–2 minutes, confirm you receive an SMS reply with your link

The reply message we used

Keep it short and neutral:

Thanks for reaching out.

Here is a quick page to help apply the $99 credit:

"your link goes here"

Common issues (quick fixes)

Gmail templates or vacation responder doesn’t work

Correct — Gmail auto-replies do not reliably route through Google Voice’s SMS tunnel. Apps Script is the workaround.

Script syntax error

Usually caused by emojis or smart quotes. Use plain text only.

No SMS reply sent

Most common causes:

· Gmail filter didn’t label the message AutoReplyNeeded

· Script wasn’t authorized

· Trigger wasn’t created or is disabled

· The forwarded email doesn’t include a @txt.voice.google.com reply address (Reply-To or From)

Form submissions not arriving

Separate issue: your form tool must be configured to send submissions to the correct inbox. If submissions go to the wrong email, fix the form’s notification recipient email.

Why this matters for small business marketing (corrected ending)

This approach turns a QR flyer into a practical, low-friction lead system. A QR scan becomes a real contact attempt, and the automatic reply delivers the next step immediately.

More importantly, this system is intentionally simple. It can be understood, adjusted, and reused—without subscriptions, vendor lock-in, or paid SMS platforms. Start with one QR code and one basic reply. Once it’s working, the same structure can be reused for follow-ups, surveys, appointment prep, educational content, or customer check-ins.

If you need help with setting up this system, contact David here: