2

In the Mobile Connect documentation is a use case described, to raise a Service Cloud case, if the answer to an sms does not match a keyword:

https://help.salesforce.com/articleView?id=mc_moc_switch_to_live_support.htm&type=5

There is a description of how to implement this, which seems to be quite clear. There is only one point, where I cannot think of how to configure this. It is mentioned, that the case description would include the actual sms message that has been sent by the contact (which of course makes perfect sense for this case):


For the unrecognized keyword response error message, add AMPscript that does these things:

  • Requests an auth token of your connected app in Service Cloud using the REST API.
  • Builds the case object payload with these required fields: status, type, and subject.
  • Optional fields include priority, origin, description, and suppliedphone. Uses HTTPPost2() to pass your payload and auth data to create the case.
  • Outputs a message to tell the recipient that someone from support will contact them soon.

A case is created with these fields and values:

  • Status, required: New
  • Type, required: Question
  • Subject, required: New Messaging Question
  • Priority: High
  • Origin: SMS
  • Description: The SMS question from the recipient
  • SuppliedPhone: The recipient’s mobile phone number

How would it be possible to capture the inbound sms message from the contact? Any hint appreciated!

  • 1
    Have you tried using the MSG(01).NOUN(01) function? I am not sure if this returns a non existing keyword. But it is worth a try. Unfortunately I don't have the possibility to try it out now. developer.salesforce.com/docs/… – user3274635 Aug 9 at 8:31
  • Thanks @user3274635, this put me in the right direction, MSG(0) will return the message. – Björn Schubert Aug 9 at 11:25
5

Maybe this will help someone else, as I had some trouble to find this in the documentation.

If you want to save or further process an inbound SMS, you can use MSG(01) variable. Help (https://developer.salesforce.com/docs/atlas.en-us.noversion.mc-programmatic-content.meta/mc-programmatic-content/mobileVariables.htm) tells us "Use this function to return the specified MO keyword used in a mobile message conversation. You can only retrieve the current keyword from MobileConnect." and also:

  • MSG(0) - Returns the message
  • MSG(0).VERB - Returns the verb of the message
  • MSG(0).NOUNS - Returns the part of the current message after the verb
  • MSG(0).NOUN(1) - Returns the second noun in the current message.

According to my test, the variable VERB [MSG(0).VERB] will provide you the first word of a message. [MSG(0).NOUNS] the part after the first word or single words after the first one with MSG(0).NOUN(x)

According to my test, you can get the whole message with the MSG(0) variable for further processing, e.G. writing it to a data extension:

%%[ 
var @msg
set @msg = [MSG(0)] 

InsertData('from_sms_test','msg',@msg)

]%% 

This AMPscript needs to be placed in the standard error message for the use case I asked for above, I guess. It needs to be verified that this actually works as I'm not able to specify a standard error message in my current test scenario.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.