How to Perpetually Send Emails In Salesforce
59
post-template-default,single,single-post,postid-59,single-format-standard,bridge-core-2.2.2,qode-page-transition-enabled,ajax_fade,page_not_loaded,,no_animation_on_touch,qode-title-hidden,qode_grid_1300,footer_responsive_adv,qode-content-sidebar-responsive,qode-theme-ver-28.5,qode-theme-bridge,qode_header_in_grid,wpb-js-composer js-comp-ver-6.1,vc_responsive,elementor-default,elementor-kit-2761

How to Perpetually Send Emails In Salesforce

Time-Based Workflow Rule Limitations

Out-of-box workflow rules come up short if you want to perpetually send emails in Salesforce. A workflow rule can only have up to 10 time triggers. To continually send emails on a daily, weekly, monthly, or quarterly cadence you could leverage batch Apex to send email messages. However, if you have a quick requirement to fulfill you may consider using workflow rules in a creative way to send these emails. To best highlight how to leverage workflow rules I will provide a sample requirement and how two workflow rules were leverage to meet it.

Requirement & Solution

Requirement: A client providing bankruptcy filing services wants to continually remind their clients via email to pay their trustee/creditor on a monthly basis. The email should include the amount due and address of where to send the payment. Emails should stop being sent on and after the date the case is dismissed.

Solution: Create a date field on the Case object that represents when you want the emails to stop. In this example we will call this the Case Dismissed Date. Create a text field on the Case object called Stop Sending Trustee Reminder Email and set the default value to “no”.

Create Workflow Rule 1: 

Evaluation Criteria: Evaluate when the record is created, and any time it’s edited to subsequently meet the criteria.

Rule Criteria:

AND(
    OR(
       ISBLANK(Case_Dismissed_Date__c),
       TODAY() < Case_Dismissed_Date__c
      ),
Stop_Sending_Trustee_Email__c = "no"
)

Workflow Actions – Immediate Actions:

Email Alert: Send Trustee Payment Reminder Email

Field Update: Update Stop_Sending_Trustee Email__c to “yes”

Create Workflow Rule 2: 

Evaluation Criteria: Evaluate when the record is created, and any time it’s edited to subsequently meet the criteria.

Rule Criteria:

AND(
    OR(
       ISBLANK(Case_Dismissed_Date__c),
       TODAY() < Case_Dismissed_Date__c
      ),
Stop_Sending_Trustee_Email__c = "yes"
)

Workflow Actions – Time Dependent Actions:

30 Days after Rule Trigger Date:

Field Update: Update Stop_Sending_Trustee Email__c to “yes”

This field update subsequently triggers Workflow Rule 1 above and sends an email out immediately (after 30 days).

Conclusion

istock_000015396036small-460x280By leveraging two workflow rules we are able to “teeter-totter” the email reminders back and forth perpetually. We are able to circumvent the limit of 10 time triggers, and don’t have to worry about a user updating a record to trigger any emails. One workflow edits the record to match the criteria in the other, and so on.

No Comments

Post A Comment