Send Text Alerts From Salesforce Using Email to SMS

Send_Text_Alerts_From_Salesforce_Using_Email_to_SMA fairly common request that I get is, “how can I send my users/customers’ text messages from Salesforce?” There are apps on the app exchange that can do this, as well as Apex solutions too. Both of those approaches typically come with an additional cost, though. If you want to impress your users and save the day with a declarative option, well you are in luck, because I just so happen to have one!

Let’s look at our use case here:

When a critical field is updated on an Account, I want to send a notification to the Account owner via text.

Pretty straightforward, right? If you already know how to create E-mail alert Workflow rules then it will be pretty easy to set this up too. We won’t be detailing the full solution here, instead  we’re just focusing on what you need to do to generate your Email to SMS Address. Let’s begin by outlining the basic steps:

  1. Create a new e-mail field on User named Email to SMS Address.
  2. Create a new picklist field on User named Cell Carrier. Your list options can be any carrier that is local to you or that your business uses. We will have several in our example below.
  3. Create a field update workflow rule that updates the Email to SMS Address field you created

That’s it, just 3 easy steps!

Let’s do a deeper dive into the workflow rule that will create your SMS email address.

I start by creating a new workflow rule on the User object and name it SMS Email create. Quick note before we go much further I am doing this on User, but you could do this same process on Lead or Contact or anywhere in the system you are capturing a mobile number. The steps, logic and syntax remain mostly the same. Just use your object instead of User. In my rule, I decided to go with logic that updates the Email to SMS Address field when:

  1. a record is new AND
    1. the mobile number field is not blank AND
    2. the cell carrier field is not blank

OR

  1. the record is edited AND
    1. the mobile number field is changed OR
    2. the cell carrier field is changed

I would also recommend adding a validation rule that enforces if a mobile number is entered, a cell carrier must also be selected and vice versa.

Here is my syntax for the rule entry criteria:

syntax rule criteria
Now let’s get into the field update action. For reference, you may be wondering what values work in the Cell Carrier pick list. Here are some examples:

cell carrier picklist

If you have any smaller regional carriers you could use them too, but only if you can find their Email to SMS address domain. Speaking of Email to SMS address domains, now is a good time to take a peek behind the curtain and explain exactly how this whole thing works.

Each cell carrier has an address that can be used to send an email to a phone via text. The specific syntax for each carrier’s domain will vary but most of them are available online. For example, if you have Verizon then your domain is @vtext.com. So if my number was 804-867-5309 (it’s not by the way!)  then my Email to SMS address would be 8048675309@vtext.com.

The field update action is taking the user’s cell phone number, extracting the special characters, and then mashing it up with the corresponding carrier’s Email to SMS address.

Let’s look at the syntax.

field update action syntax

The substitute function is finding the “special” characters (dashes, spaces, commas, etc) and effectively deleting them. Once that has been done we use a Case statement to determine which Carrier is selected and insert the corresponding Email to SMS address domain. Pretty easy, right?

Once the field update fires, you should now have your Email to SMS field populated with the correct address. At that point, you are ready to send your first text!

Now you can create your email alert template(s) and additional Workflow rule(s) and then test them out. When a user/contact gets a text it will be formatted something like this:

text message example

The part before the forward slash (“/”) is the subject, and everything after is the body. Remember when creating your email templates that these are text messages, so brevity is going to be your friend here!

That’s it – you are now ready to send text messages out of Salesforce via Email Alert Workflow rules. All in all, pretty easy I think, and pretty cool too!

 

  • How To

    Send Text Alerts From Salesforce Using Email to SMS

    Tweet Pin Share ShareA fairly common request that I get is, “how can I send my users/customers’ text messages from Salesforce?” ...
Load More Related Articles
Load More In How To

39 Comments


  1. Jessica Tanner

    July 6, 2015 at 9:05 am

    This is a great post. An issue that I’m struggling with is the amount of text messages customers send to my sales and service teams. I haven’t had much luck in finding an easy solution to get those texts documented in SF. Would love to hear ideas/solutions 🙂 Considering that I want to be an Admin Hero when I grow up, I really love this site!

    Reply

    • Brent Downey

      July 6, 2015 at 10:32 am

      Hi Jessica! This is a really interesting situation. I haven’t had customers contacting reps directly via text message. I don’t know of a quick and easy way to get this done except to have them copy the text message and past it into Salesforce1 task or “Log a Call.” If I find a different solution, I’ll let you know!

      Reply

    • Karen Robinson

      August 31, 2016 at 6:39 am

      Why not try 360 SMS app. It will surely solve your problem regarding incoming messages from your customers,easy to use and many features at economical cost. https://appexchange.salesforce.com/listingDetail?listingId=a0N3000000DpSyIEAV

      Reply

      • Brent Downey

        September 18, 2016 at 3:03 pm

        Hey Karen! Great suggestion! This post was written a year before that app was released. Great find – thanks for sharing!

        Reply

  2. Kari Bryan

    July 6, 2015 at 10:54 am

    This is amazing!! Thank you for posting this solution! However I am receiving the following formula error:

    Error: Function ISNEW may not be used in this type of formula.

    Here is my code:

    OR(
    AND(
    ISNEW(),
    NOT(ISBLANK( Mobile_Phone__c ) ),
    NOT(ISBLANK( TEXT( Cell_Carrier__c ) ) ) ),
    OR(
    ISCHANGED( Mobile_Phone__c ),
    ISCHANGED( Cell_Carrier__c ) ) )

    Reply

    • Carlos

      July 6, 2015 at 11:18 am

      Hey Kari!

      Try selecting ‘created, and every time it’s edited’ in Evaluation Criteria section!

      Good Luck!

      Reply

      • Brent Downey

        July 6, 2015 at 11:41 am

        Thanks for helping out Carlos!

        Reply

        • Carlos

          July 6, 2015 at 3:05 pm

          You’re welcome!
          I’ve already tried this workflow rule in my Developer ORG, however I didn’t get the Email to SMS in Mexico (Telcel from America Movil), but this is a great post!

          Thank you!

          Reply

      • Kari Bryan

        July 6, 2015 at 2:15 pm

        That worked! Thank you!

        Reply

  3. Brian Fey

    July 6, 2015 at 2:31 pm

    Thanks for this feature.

    Question: When using an Email Alert — how do I get the email to go to the “Email to SMS” address — not the primary email address?

    NOTE: I looked up a few other Cell Carrier email/text addresses:

    “CellCom”,”@cellcom.quiktxt.com”,
    “Cricket”,”@sms.mycricket.com”,
    “Metro PCS”,”@mymetropcs.com”,
    “TracFone”,”@mmst5.tracfone.com”,

    Thanks.

    Reply

    • Brent Downey

      July 6, 2015 at 4:00 pm

      Hi Brian! It depends on the object that the workflow rule is being created on. If you want to send an alert to the Opportunity Owner for example, create a hidden email field on the Opportunity record and create a field update workflow rule to populate the SMS email from the user record. This opportunity-based email field can then be used as the recipient email address in your SMS alert workflow. I hope that helps!

      Reply

      • Aron Schor

        July 17, 2015 at 7:26 am

        Hi Brent, is it possible to send texts to specific user(s)/Groups if I create a new Account, for example? It seems that would just send to the Account owner. Also, how do you fire the field update? I set this up on User but nothing happened, but then I updated cell carrier and the Email to SMS field was populated. Sorry, a bit new to this!

        Reply

        • Brent Downey

          July 21, 2015 at 4:27 pm

          Hi Aron! The email to SMS address will be unique by user based on their specific phone number and carrier. Because it’s tied to a specific user in Salesforce, you may not be able to create a group. I would have to play with that to validate it. The field update you may have seen in the comments thread is it’s own workflow. The idea would be to bring in the email to SMS address to a record (such as an Opportunity or custom object) in order to use the SMS email address to trigger the email alert. This is done as a totally seprate workflow rule with a field update action. The update would be the SMS email address from the user record.

          Reply

          • Aron Schor

            July 23, 2015 at 4:59 pm

            Thanks Brent, I think I understand the basics, but please correct me if I am mistaken. So Workflow rule would populate the SMS Email field in Opportunity based on SMS Email of the User (owner) for all Opportunities, and then changes could be sent via text? If so, I might try figuring out how to set that up!

            Reply

  4. Kari Bryan

    July 6, 2015 at 2:39 pm

    This is to piggy back on Jessica’s question above: how would you go about dealing with users who want to Opt Out of SMS messages sent through SF? And how would those opt outs be translated back to Salesforce via a response to the SMS?

    This really is an amazing site! #AdminHeroRules

    Reply

    • Brent Downey

      July 6, 2015 at 4:01 pm

      Opt out is a great point Kari! I suppose you could create a checkbox on the user record that would allow the user to opt out of these alerts, but it would probably have to be updated manually. If I can think of a way to automate that, I’ll post an update!

      Reply

  5. Mark Deuel

    July 6, 2015 at 2:39 pm

    Awesome post, thanks!

    Reply

  6. Donald Bohrisch

    July 6, 2015 at 4:30 pm

    That is pretty wicked, thank you for the great insight on this possibility… as always, You Rock!

    Reply

    • Brent Downey

      July 8, 2015 at 8:06 am

      Thanks Donald, but I can’t take credit for this post! It was all Adam this time!

      Reply

  7. Brian Fey

    July 7, 2015 at 11:15 am

    Works like a charm!

    I had never used the full power of “Recipient Type” in the Email Alert config before.

    Thanks for the insight!

    BFey

    Reply

  8. Robert Boyd

    July 7, 2015 at 1:54 pm

    This is an amazingly useful post! Big shout to to Adam Marks for a cool solution.

    I was able to take this concept and automatically send SMS alerts to a Contact when Conga Composer merges and emails a document to them. Works like a charm!

    Reply

    • Brent Downey

      July 7, 2015 at 2:30 pm

      This is awesome Robert! What a cool way to leverage text alerts AND Conga!

      Reply

  9. Joanne

    October 30, 2015 at 7:08 pm

    Excellent! but I can’t get it to work. I tested the format of sending an email from one phone to another using 1112223333@vtext.com and the text comes in (good). Then I added an email field to a simple object and filled in the same text, created a simple text template (no embedded fields), created a workflow rule to send the email to that address and update another field on the form just to be sure the rule was running. The field gets updated on save but the text message never arrives. What am I missing?

    Reply

    • Joanne

      October 30, 2015 at 7:24 pm

      My bad…I was trying this in our sandbox that had “Access to Send Emails” = System Emails, changed to All Emails and this works GREAT…Thanks!

      Reply

  10. Margot W

    January 10, 2016 at 9:37 pm

    Pretty cool! I got it to work! Can’t wait to share it with the team! Thanks so much Adam & Brent!

    Reply

    • Brent Downey

      January 11, 2016 at 8:25 am

      Awesome! So happy it worked for you!

      Reply

      • Margot W

        April 19, 2016 at 1:08 pm

        I just updated the field update formula value to accommodate the following mobile format:
        +1 5034440579

        Replaced: SUBSTITUTE(MobilePhone, “(“, “”), “)”, “”), ” ” , “”), “-“, “”)&

        With: SUBSTITUTE(MobilePhone, “+1 “, “”), “(“, “”), “) ” , “”), “-“, “”)&

        Reply

  11. Michele

    January 26, 2016 at 2:39 pm

    This looks like a great solution. But I don’t think our Leads will want to tell me their provider. Any advice on how to get that info?

    Reply

    • Pintu Francis

      April 7, 2016 at 5:15 am

      Extend this functionality by using Twilio number lookup API to get the carrier name for the number and match it with list of preset carrier name – domain name pair in custom settings. 🙂

      Reply

  12. Ann

    June 13, 2016 at 11:38 am

    I am stuck with adding this email alert to my workflow rule. When I am choosing the “Recipient Type”, it doesn’t give me an option to select the newly created Email Address field.

    Reply

  13. Adam Marks

    Adam Marks

    June 13, 2016 at 12:07 pm

    Hey Ann! On which object did you create the field, and is that the same object your rule is evaluating against?

    Reply

  14. Jeremy Thompson

    July 24, 2016 at 10:50 pm

    I’m having the same problem as Ann. I can’t seem to access the newly created field for my workflow. I want to write the workflow so that when the “status” of a campaign member is set to a certain picklist option, the user gets a text message. So, the workflow rule is evaluating against the campaign member object. I created a User lookup field on the campaign member object to indicate when someone wants to get an alert through this process, but I’m not sure how to get the workflow to choose the correct email address on the user object.

    Reply

    • Adam Marks

      Adam Marks

      July 27, 2016 at 7:55 am

      Jeremy,

      Campaign member is a junction that allows you to pull in related Leads and Contacts, not Users. You would need fields on both Contact and Lead with workflows to create the SMS email on each object independently. The example I wrote just covers SMS text to users but could be applied to any person object (Lead, Contact or even a custom object!)

      Reply

  15. Josh High

    July 25, 2016 at 7:56 pm

    I’m having trouble opening up the syntax editor on the New Custom Email Field. I am the admin of my account, do I need to unlock a permission or something? Or do I need to create a custom formula field instead of an Email field?

    Reply

    • Josh High

      July 27, 2016 at 7:43 am

      I figured out how to open up the rule criteria code box, now I’m trying to figure out where to put the second syntax example. The one starting with SUBSTITUTE. Does that go right below the first piece of code?

      This is what my code looks like:

      OR(
      AND(
      ISNEW(),
      NOT(ISBLANK(MobilePhone)),
      NOT(ISBLANK( TEXT(Cell_Carrier__c)))),
      OR(
      ISCHANGED(MobilePhone),
      ISCHANGED(Cell_Carrier__c)))

      SUBSTITUTE(
      SUBSTITUTE(
      SUBSTITUTE(
      SUBSTITUTE (Mobile Phone, ” (“, “”) , “) “, “”), ” “, “”), “-“, “”)&
      CASE(TEXT( Cell_Carrier__C),
      “Alltel”,”@message.alltel.com”,
      “ATT&T”,”@txt.att.net”,
      “Boost Mobile”,”@myboostmobile.com”,
      “Sprint”,”@messaging.sprintpcs.com”,
      “T-Mobile”,”@tmomail.net”,
      “US Cellular”,”@email.uscc.net”,
      “Verizon”,”@vtext.com”,
      “Virgin Mobile”,”@vmobl.com”,
      NULL)

      Reply

  16. Adam Marks

    Adam Marks

    July 27, 2016 at 7:50 am

    Hey Josh! Those are two separate items. The first bit of syntax is for your rule entry criteria. The second is for your field update action. Create your WFR and in the rule entry criteria set it to evaluate a formula and then paste in:
    OR(
    AND(
    ISNEW(),
    NOT(ISBLANK(MobilePhone)),
    NOT(ISBLANK( TEXT(Cell_Carrier__c)))),
    OR(
    ISCHANGED(MobilePhone),
    ISCHANGED(Cell_Carrier__c)))

    Then click next to take you to a screen to add an action to your rule. Create an update field action and then use the other syntax to define the logic to update the SMS Email field you created.

    Hopefully that helps!

    Reply

  17. Melissa

    September 29, 2016 at 3:55 pm

    Thanks for this post! My use case is slightly different: We’d like a way to send texts to clients when there are service interruptions. Currently we use the mass email feature (which we’d like to retain the ability to do) but since sometimes these are time-sensitive we’d like to use SMS as an alternative. I’ve got the custom SMS Email field set up so that I can send texts on an individual basis. Does anyone know of a way to do a mass email/text on the custom SMS Email field rather than the standard Email field?

    Reply

  18. Josh G.

    November 7, 2016 at 10:10 am

    Hi Adam,

    This is a really great article & a great idea overall. I’ve set this system up in a number of SF accounts at this point but I have noticed a few things. First, cell carrier limitations are not our friend. I’ve found that messages all-too-often get truncated to below useful limits. UNLESS, you use the MMS email address rather than the SMS email address.

    However, when I switch to an MMS email address I cannot get emails to send out from SF to Verizon. It works AMAZINGLY to all other carriers but the message won’t send at all to any Verizon subscriber. Any idea why?

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *

Sponsors

Rollup Helper Ad photo Passage Tech Admin Hero Ad_zps9nqtyvvs.gif  photo Need Top Salesforce Consultant Now- 1_zpssntu5iqt.png