Skip to main content

Sending SMS or text alert messages from Salesforce



This is a great tip for Salesforce administrators that I read about recently in one of my favorite blogs for Salesforce - Adminhero.com. Many times we encounter requirements asking to alert users on the phone when something important happens in the system. There are different ways to alert users on their mobile -

  1. Salesforce1 push notifications and in app notifications:  If you have deployed Salesforce1 mobile app to your users, they can be notified via the app. For example: Chatter notifications which are a result of @Mention in posts can result in a push notification to the user. 
  2. Email notifications: Nowadays most enterprise customers have provided their employees access to official mail on mobile phones with appropriate security enabled. So sending email based notifications can many times solve the user requirement. However be mindful of sending too many emails as that reduces the effectiveness of this tool.
  3. SMS or text alerts : This can be appropriate if there are really highly important messages that need to be sent to user's mobiles. We will talk about this approach below.


Most cell carriers in the USA have an email address format that can be used to send text alerts to a phone. For example if the phone to message is 8041234567 and the carrier is Verizon, the email address that can be used to send the text alert will be 8041234567@vtext.com. Similarly if the number is 8041234567 and the carrier is At&t, the email address will be 8041234567@txt.att.net.

So what we need is to capture the phone number and the cell carrier company of our users. This can be exposed as fields on the user interface. The cell carrier can be a picklist with dropdown choices showing options such as Verizon, At&t etc. 

We can configure a workflow rule that  populates a custom email address field on the User object with the email address that can be used to send the text message. For example, a formula that concatenates the phone number and carrier information would look like below -

IF(OR(ISNULL( MobilePhone ),ISNULL( TEXT(Cell_Carrier__c) )), '', MobilePhone + SUBSTITUTE( TEXT(Cell_Carrier__c) , 'Verizon', '@vtext.com') )
*** Above i just used one substitute but we can expand it to add more Substitutes for other carriers like At&t.

Once the User SMS email address field is populated, it can be copied over to a custom email address field on the object, on which we want our workflow for sending text messages to be based on. For ex: On Contact object, I created a custom Email address field with a default formula to get the $User.SMS_Email_Address__c and also if necessary a workflow to keep this field up to date. Now I have a email field on the object I need containing the 8041234567@vtext.com populated.

Once this is populated, we can configure simple workflow rules to send emails to this custom email address field. 
Note: the email content should be short and appropriate for text alerts.

Thats it, with a formula field and a couple of workflows, you can send text alerts to users. This is definitely a great hack that has been shared with us. I tested this out on my developer salesforce edition and it works great! Hope this helps you out!


Comments

Popular posts from this blog

Workaround to bypass Salesforce SSO

One of the best practices for implementing Single Sign On for your Salesforce org is always ensure there is a way your System administrator can login via the standard login page side-stepping the SSO configuration.  Reason for this is if ever something goes wrong with your Idp provider's service and the SSO authentication responses are not coming as expected, all your users are unable to login. That is, if you have setup your My domain to prevent logins via standard Salesforce login urls (login.salesforce.com). This includes the System administrator as well. Only if your system administrator can somehow login, then he or she can disable the SSO settings for your domain and allow login via the normal login page as a temporary measure. What do you do in such a situation? Well Salesforce has built a workaround for this which is not well documented anywhere (probably for a good reason :) ). I found out about it from a colleague at work. If your my domain url is - https://Com

Salesforce Big Objects - Key learnings

I remember reading about Salesforce Big Objects before they became available and thought maybe it is an option to backup data present in regular objects. That is, instead of taking a backup via an ETL tool or data loader, maybe this will be an option to backup the data in the Force.com platform itself. Now that it is GA and I am reading more about it, i think the use cases for this are more varied. Some use cases I can think of are –  Archival of key data objects within the platform: You may want to use this option if you dont use any other means to backup key data. Also this may be an attractive option for non-large enterprise customers who dont themselves invest on large data warehouses or data lakes in their enterprise architecture. Ex: customer history (if present in tasks and activities) will become huge over years but this is useful information for reporting & customer analysis. Store key information which is large volume in quantity and also high volume in transa

DBAmp for Salesforce - salesforce integration for SQL Server DBAs

Recently i got the opportunity to explore a tool called DBAmp for integration with Salesforce. I found it to be a very useful tool which will help with any data manipulation requirements in Salesforce. Following are my learnings from the exercise. Hope it helps any of you who may need to work with this tool -  DBAmp is a SQL Server package that can be used to integrate with Salesforce. The site where this software is available is - http://www.forceamp.com/ Overview: It essentially installs on top of an existing SQL Server database and provides an OLE DB connector that can be used to connect to Salesforce. Behind the scenes, it executes API calls against Salesforce for any SQL server command it receives. Thus we can create a connection in SQL server to Salesforce org and pull data into tables in the database just as if we are querying against Salesforce tables directly. Use cases for DBAmap + Salesforce: Many use cases exist for using this tool against Salesforce. Pr