4

I have set up a Process in Process Builder that sends an email alert via a scheduled action. All works fine and my client is happy.

However, they have queried about what time the email alert will be sent as they are concerned clients may get emails at midnight or later.

Is there a way to only allow the email alert to be sent from salesforce within a certain timeframe (i.e. business hours)? I can't see a way in Process Builder, but maybe there's a way at another level in salesforce that isn't too convoluted?

3
  • Do you just want to not send it? Or schedule for the next available time? How are you setting the schedule?
    – Adrian Larson
    Mar 18, 2016 at 19:49
  • there's probably an easier way but with an apex scheduled job that only scheduled itself to run during business hours, the process could insert an object indicating the (ID of the sObject, ID of the emailTemplate). The scheduled job would then use Apex to send email (be limits aware here)
    – cropredy
    Mar 21, 2016 at 1:30
  • How are you triggering your Process Builder action? If you simply have a piece in that time trigger that if after X you move to the next day...? Might be easiest to do in a custom field instead of in the PB... but that would be an option for you to run it off of something like that Mar 21, 2016 at 3:27

2 Answers 2

0

everything depends on how you built your process. The process itself will tell you if it is possible to execute the email alert on non-business hours. However, if you want to be sure I will go for an apex scheduled to run during certain hours. Your process could update a value (example like a checkbox emailAlert__c to false) that your schedule will read and if (emailAlert__c=false) the schedule can send the email and after that, update that value emailAlert__c==true.

It's a suggestion that I'm using and works perfectly, but everything depends on the way you built your process.

0

Recently I got a requirement to schedule email alerts based on business hour for any record creation in custom object. Below are use case and requirement.

Use Case :

We have a custom object, when record is created in that object send a email to user after 2 hour of record creation. Email will be sent in business hour only.

Business Hour is set to 10AM-6PM for each working day. Saturday and Sunday are holiday.

Requirement:

  1. If record is created at 5PM then system should sent email at 1 PM next day.

  2. If record is created at 5PM on Friday then system should sent email at 1 PM next Monday.

Solution:

To solve this use case, we will need to do below tasks

  1. Create a custom field in object to store reminder time.
  2. Create Custom Setting for Reminder Time
  3. Create InvocableMethod class to get next business date
  4. Create a Email Template and Email Alert for Notification
  5. Create process builder to schedule action based on custom field created
  6. Test functionality

I got Reference from this link to solve my issue and you can also follow the same to resolve your issue. Reference Link: SCHEDULE EMAIL ALERTS BASED ON BUSINESS HOURS

1

You must log in to answer this question.

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