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?

  • 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 '16 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 '16 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 – David Litton Mar 21 '16 at 3:27
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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.