Configure Auto Reply SMS BY Google Voice

Add the Email filter in the Gmail

  1. Create a filter (any text sent to a google voice number goes to your gmail with the following address appended to it)
  2. Matches: from:(@txt.voice.google.com)
  3. Do this: Skip Inbox, Apply label “autoreply”

Add google scripts as a document type

  1. Go to Google Drive
    Click New –> More –> Connect more apps –> Search for “google apps scripts“ (by Google) and add it.
  2. Now create a new script: New –> More –> Google Apps Scripts.
  3. Name the script “Auto Replier
  4. Replace what you see with the code from below :

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    function autoReplier() {
    var labelObj = GmailApp.getUserLabelByName('autoreply');
    var gmailThreads;
    var messages;
    var sender;

    for (var gg = 0; gg < labelObj.getUnreadCount(); gg++) {
    gmailThreads = labelObj.getThreads()[gg];
    messages = gmailThreads.getMessages();
    for (var ii = 0; ii < messages.length; ii++) {

    if (messages[ii].isUnread()) {

    msg = messages[ii].getPlainBody();
    sender = messages[ii].getFrom().slice(16, 74);

    MailApp.sendEmail(sender, "Auto Reply", "Hi, I'm out of town till the end of the month. Talk to you then!");
    messages[ii].markRead();
    messages[ii].moveToTrash();

    }
    }
    }

    }
  5. After you’ve saved the code, perform these steps:

  6. Click Edit
  7. Select Current Projects Triggers
  8. Select autoReplier, Time-driven, Minutes timer, Everyminute
  9. Hit save.
  10. Approve any permissions that pop up.

Voila, now you have an auto reply system.

If the script doesn’t work ,please try change the code
sender = messages[ii].getFrom().slice(16, 74); to
sender = messages[ii].getFrom();