function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
RDSSRDSS 

Send SMS after 7 days of a particular date.

I am using SMS Magic for sending SMS. I am sending SMS when status is Submitted. Now i am stuck at where i need to send an SMS after 7 days from the date when the application was submitted. I have written a trigger to send SMS for submitted status. How it can be achieved? Please help.
Pankaj MehraPankaj Mehra
Hi Ramandeep Singh 24

You need to create a Apex flow to achieve the above process, Apex Flow can trigger a operation after a specific date (in your case 7 days after status changed)

You can initiate flow in 2 ways:
1. From Apex code (from trigger when status changed)
 
public class FlowController {

   //Instance of the Flow
   public Flow.Interview.doubler myFlow {get;set;}
   public Double value {get;set;}

   public Double getOutput() {
      if (myFlow == null) return null;
      return (Double)(myFlow.getVariableValue('v1'));
   }

   public void start(){
      Map<String, Object> myMap = new Map<String, Object>();
      myMap.put('v1', input);
      myFlow = new Flow.Interview.doubler(myMap);
      myFlow.start();
   }
}



2. From Process builder : Create a new process from Process Builder and add status change condition when records is craeted/updated, next is to initiate a flow from process builder.

Create a flow with Flow Wait Element 
https://developer.salesforce.com/docs/atlas.en-us.salesforce_vpm_guide.meta/salesforce_vpm_guide/vpm_designer_elements_wait.htm


and From flow [After 7 days wait condition in flow ] call Apex code where you will call your SMS Magic for sending SMS.


Thanks



If you're satisfied with the answers provided, please don't forget to select a Best Answer.
Palak Singhal 5Palak Singhal 5
Hi,

This is definitely possible through 360 SMS App which is natievly built on salesforce. In this app, process builders are used well to create any kind of automation processes. In addition to SMS scheduling they have provide their users with many more advanced features.

For more detailed information, you can try a free version their app with the help of this link: (https://appexchange.salesforce.com/appxListingDetail?listingId=a0N3000000DpSyIEAV)
Ela SwanEla Swan
Hi,
Scheduling messages is such a crucial feature in today’s date and I recently noticed that 360 SMS App offers this functionality. In this app, process builders are used well to create any kind of automation processes. In addition to SMS scheduling they have provide their users with many more advanced features.

For more detailed information, you can check out this link: https://appexchange.salesforce.com/appxListingDetail?listingId=a0N3000000DpSyIEAV