Introduction:
In my previous post we have seen how we can send email alerts to static recipients for case comments using standard worklfow email alert "http://salesforcefox.blogspot.in/2012/10/email-alerts-for-case-comments-using.html".
In this post I am going to walk you thru
- how to send email alerts to dynamic recipients for case comments using standard salesforce feature.
Screen shot for reference
Step 2: Create workflow rule for Case object. Evaluation criteria would be "created or edited".
Screen shot for reference
Step 3: Create New Email Alert action for the created workflow rule. Choose the Email Template which we have created in Step 1. Unless like in the previous post, here recipients could be any persons who are related to that case. For example recipient could be Related Contact / Related User / Related Lead / Account Owner / Email Field (in case object) / Case Owner / Customer Portal User / User / Roles / Public Groups.
Step 4: Activate the workflow rule.
Field Creation:
Create a long text area field in Case object. I would suggest to give the name as "Recent Case Comment" since value in this field is always going to be latest case comment of this case.Create Workflow to Populate "Recent Case Comment" Field:
Step 1: Create workflow rule for Case Comment object. Evaluation criteria would be "created".
Screen shot for reference
Step 2: Create New Field Update action for the created workflow rule. Field to Update = Case objects "Recent Case Comment" field and Value formula = CommentBody.
Step 3: Activate the workflow.Screen shot for reference
Step 2: Create New Field Update action for the created workflow rule. Field to Update = Case objects "Recent Case Comment" field and Value formula = CommentBody.
Create Workflow to Send Email Alerts:
Step 1: As a first step create Email Template for sending email alert.Screen shot for reference
Step 2: Create workflow rule for Case object. Evaluation criteria would be "created or edited".
Screen shot for reference
Step 3: Create New Email Alert action for the created workflow rule. Choose the Email Template which we have created in Step 1. Unless like in the previous post, here recipients could be any persons who are related to that case. For example recipient could be Related Contact / Related User / Related Lead / Account Owner / Email Field (in case object) / Case Owner / Customer Portal User / User / Roles / Public Groups.
Screen shot for reference
Step 4: Activate the workflow rule.
Testing Results:
Once
we are done with the above steps we are ready to receive case comment
notification dynamically. Below is my testing results. I have highlighted the merge
fields results for easy understanding.
Screen shot for reference