97. How does the app relate the incoming messages to records in Salesforce ?

There are 2 ways in which Incoming gets associated with Salesforce records:

  • Whenever you send a message to a new record, a Conversation Record gets created. Conversation is Parent Object to SMS History. Once the message is sent it will be attached to that Conversation. If you get a reply from that mobile number we check the Mobile Number and Sender id on the Conversation Object and attach it to the last created Conversation if there is any. If there is no Conversation for the Mobile Number and Sender id combination a new Conversation Record is created.
  • Whenever a new incoming message is received, we check if this message is a response to an existing outgoing messages based on Phone number and sender ID. If there are more than one such outgoing messages, we consider the response to be for the latest outgoing message. This message is looked up as previous message. If a previously sent outgoing message is found, we associate the incoming message with the same conversation as the previous outgoing message. If a previous message is not found, we find the number in all objects configured in Object Config and populate a lookup of all such objects. After this, our application applies a logic to identify the primary object to which this message should be associated with. Finally, a conversation is created / associated for the incoming message based on Phone Number, Sender ID, Primary Object, Primary Object ID and User criteria. If an existing conversation exists where all the 5 attributes match the incoming message, it is used to associate the new incoming message. If no such conversation exists, a new conversation is created.

Conversations in SMS-Magic Converse are created in the following way:

When an Outgoing message is sent if there are no Conversations with the same Mobile number, Sender ID, Owner ID, Object and record ID a new Conversation will get created. If there is an existing Conversation Record, the Outgoing message will get attached to it. If any of the value (Mobile number, Sender ID, Owner ID, Object and record ID) changes, a new Conversation record will get created.

Similarly when you receive an incoming message, if there is a Conversation Record with the Mobile number and Sender ID it will get attached to it. If there is no Conversation it will create a new one.

Important Announcement!

URGENT! Please register the 10-digit business phone number (e.g. 555-555-5555) that your organization uses to send texts to consumers in the U.S. Failure to register may cause heavy penalties and disruption to all your text messaging communications.