eWe have a feature on incoming SMS where the last sender of outgoing SMS is notified via email. Let me explain this in more details - 


Last Sender - this means that if USER A is the sender of the text message and you receive an incoming sms from the same number, in this case, USER A would become the owner of Incoming SMS and can get notified via email on incoming SMS.


You can configure the last sender notification using the following steps:


1. You need to have a lookup relationship between Incoming SMS object and SMS History object

--> 

  • Go to Setup > App Setup > Create > Objects
  • Select "Incoming SMS" object
  • Click on "New" for "Custom Fields & Relationships"
  • Select the type as "Lookup Relationship"
  • Select the object as "SMS history"
  •  Save


2. Now, this lookup relationship should be automatically updated.

--> 

  • Go to SMS settings tab on your salesforce.
  • Click on "Configure action on Incoming SMS" button
  • Go to "Configure action on Incoming SMS" section and click on New.
  • You will find the following screen (refer image below)
  • Select the object name as "SMS History"
  • Select the Mobile Field name as "Mobile Number"
  • Select the Reference Field Name as "SMS History"
  • Select the SMS Owner as "Record Owner"
  • Keep the Notify owner as unchecked
  • Save



3. Now we will create an email template and email alert which will be used to notify the last sender.

--> Email Template

  • Go to  “Setup” on the top right corner of the Salesforce Instance.
  • On the Left Panel ->  “Administrator” -> “Communication Templates” -> “Email Templates”. 
  • Click on “New Template” and then create a new email template as per your requirement.

You can add an email template body (sharing an image for the same)


As shown in the image you can add the following items in the email body –

· Sender Name

· Date of Creation of SMS

· Mobile Number of the Sender

· SMS Text


--> Email alert

  • After you are done with the Email Template, you need to set Email Alerts. Please follow the below instructions –
  • Go to “Setup” on the top right corner of the Salesforce Instance.
  • On the Left Panel -> on the Search text box, type “Email Alerts ”.
  • Click on new Email Alerts and fill the required fields.
  • Enter description.
  • Select object “ Incoming SMS “.
  • Select Email template created earlier.
  • Select the recipient type as Owner and then select the Incoming SMS owner
  • Save



4. After you are done with the Email Template, you need to setup a process builder. With the process builder we will update the incoming SMS owner as the last sender and then trigger the email alert. Please follow the below instructions –