4

I have a business requirement to send email alert 7 days after Opportunity Close Date @ 9 AM CET time. But i dont see any option where I can specify time or hours in Process Builder. I see option for number of days only. Does anybody know if we can send email alerts at a specific time or not using Process Builder Flows.

1
  • 2
    This could be achieved by standard time dependent work flow rules. Create a DateTime field as Event_Trigger_Date_Time. Now as soon as close date gets updated, update the Event_Trigger_Date_Time with 9 AM CET same as the close day. What you are doing is setting the time to 9AM. Now write standard time dependent work flow rules to trigger after 7 days of Event_Trigger_date_Time and send an email. Hope this helps you. Similar kind of approach is followed here: techstuffdiary.wordpress.com/2014/06/04/… Sep 18, 2016 at 4:01

2 Answers 2

1

From what I know of time-based workflow/Process Builder flow, the units of time supported to schedule an action are days and hours and not a particular time.

A programmatic approach would help you to deliver the requirement. You can create a schedulable class, which runs a batch apex at 9 AM CET every day. In the batch class, you can query the opportunities closed 7 days ago (within 24 hours on the 7th day) and send an email. Few references and hints to help you go ahead.

1> you can use N_DAYS_AGO : 7 criteria in start method query in the batch job

2> SingleEmailMessage class and methods to send emails

Batch class:

https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_batch_interface.htm

Apex Scheduler:

https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_scheduler.htm?search_text=schedule

Send Email:

https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_classes_email_outbound_single.htm

1
  • 1
    A small comment: Salesforce schedules jobs for execution at the specified time but the actual execution may occur after that time, depending on job size and service availability.
    – user28311
    Jul 24, 2017 at 8:22
-1

I know this is a bit of a late answer, but we now have scheduled flows, which will allow you to do this declaratively and easier way. You can s

1

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .