Thursday 11 October 2012

Email alerts for Case Comments using Standard Workfow Email Alert in Salesforce

Introduction: 

In this post we are going to see how to send email alerts for Case Comments using standard workflow email alerts.

As most of the salesforce developer's knows
   - Though we can create Workflow Rules for Case Comments object, there is no option for choosing Case Comments object and its fields while creating Email Templates. So they will think that there is no option for sending email alerts for Case Comments using standard Workflow Email Alerts but this is not true.

Even though Case Comments fields are not available in the "Available Merge Fields" section in the Email Templates, we can manually enter Case Comments fields (in the standard merge fields formats) in the email templates, sf will automatically replace all these fields properly and send email alert to the specified email ids.

Create Email Template:

Create sample email template for case comment notification. Assume the email template name as "Case Comment Notification Template". While creating email template you can specify case comment fields using the standard merge field format {!CaseComment.XXXX}. For example, if you would like to display the comment body then merge field would be {!CaseComment.CommentBody}, like wise we can access all case comment fields.
One more cool thing is we can also specify the Case fields. e.g: {!Case.CaseNumber}, {!Case.Subject} and so on... 
Screen shot for reference
 

Create Workflow Rule and Email Alert:

Step 1: Create workflow rule for Case Comment object. Workflow Evaluation Criteria would be "Created".
Step 2: Add "New Email Alert" workflow action to the created workflow rule. While creating new email alert choose already created email template "Case Comment Notification Template" and choose relevant recipients. 
Note: Recipient could be any User / Customer Portal User / Public Groups / Roles.
Step 3: Activate the workflow rule.
Screen shot for reference

Testing Results:

Once we are done with the above steps we are ready to receive case comment notification. Below is my testing results. I have highlighted the merge fields results for easy understanding.

Screen shot for reference


Disadvantages:

As we all know here disadvantage is "We cannot send email alerts to dynamic recipients". Since recipients are chosen statically i.e either User / Public Group / Roles, there is no way to send email alerts dynamically to any user related to Case and so on... 
So the scope of this facility is limited as of now, but if salesforce starts supporting field creation in Case Comment then we will be all set with this feature. 
Yes, I know until then we need some workaround for solving this issue which I will be walking you thru in my next post "Email alerts to dynamic recipients for Case Comments using Standard Workflow Email Alert in Salesforce".

12 comments:

  1. Patience is not simply the ability to wait it's how we behave while we're waiting. See the link below for more info.

    #patience
    www.ufgop.org

    ReplyDelete
  2. This is my first time i visit here and I found so many interesting stuff in your blog especially it's discussion, thank you.
    email newsletter templates

    ReplyDelete
  3. CaseComment.CommentBody does not work.
    It should be {!Case.Last_Case_Comment}

    ReplyDelete
  4. Neither of these work for me. Any ideas?

    ReplyDelete
  5. Same . Both was working one month ago for me in my sandbox org but now when I deposed the same in production . It fails and now not even working in sandbox tooo.

    Awaiting any workaround

    ReplyDelete
  6. I think this is an informative post and it is very beneficial and knowledgeable. Therefore, I would like to thank you for the endeavors that you have made in writing this article. All the content is absolutely well-researched. Thanks... ethereum transaction alerts

    ReplyDelete
  7. I havent any word to appreciate this post.....Really i am impressed from this post....the person who create this post it was a great human..thanks for shared this with us. find contact info

    ReplyDelete
  8. I just got to this amazing site not long ago. I was actually captured with the piece of resources you have got here. Big thumbs up for making such wonderful blog page! Team Training

    ReplyDelete
  9. It is the generic salesforce mail you are getting nothing new. WHat you did has no use and the generic one gets an upper hand to it. Try altering your email template and see for yourself

    ReplyDelete
  10. Thanks for an interesting blog. What else may I get that sort of info written in such a perfect approach? I have an undertaking that I am just now operating on, and I have been on the lookout for such info. https://www.searchenginejournal.com/social-sharing-sites/261563/

    ReplyDelete
  11. Thanks and that i have a swell supply: Where To Start With Whole House Renovation split level home kitchen remodel

    ReplyDelete