Share via


Send Mail To Team using Custom Workflow Activities in CRM 2013/2015

If the users like to send mail to all the team members when a case is assigned to a team. This cannot be done OOB so to achieve this we can write a custom workflow activity and use it in a workflow to send mail to all the members of the team.

1. Create a custom workflow activity from visual studio that accepts “From User” which is the user from which the mail will be sent and "Template Name" which is the Email template name as an input parameter

     From ID input parameter

       Template Name input parameter

    

 2.   Write the following code in Execute

      

3. GetTemplateByTitle method

           

4. SendEmail method

          

            

5. CheckOwnerIsUserOrTeam method

         

6. GetMembersOfTeam method

   

7. Create a workflow with the following details (i.e. add a step to call our custom workflow activity)

               

     

Cheers!!

Shraddha Dhingra