locked
Approach to add all activities to email message before an email is sent out from workflow RRS feed

  • Question

  • Hi,

    I am trying to achieve below requirement:

    We have a workflow set up which gets triggered when the record is created for a particular (Coverage team) entity. This workflow has a "Send Email" 

    step and  when the record is created, an email gets sent out with properties properties like lead number, address etc.

    As a part a new requirement, we would like to display all the activities (email, phone, notes etc) into that email body.

    Our so far approach:

    1. Add a field called "Customer Notes" but hide it on lead form.

    2. On the Save event of Coverage team form,  we fired a javascript function that binds all the notes for that lead in a bulleted format to Customer Notes Field. With this approach, sometimes Send Email step executes first and Javascript later, because of which Customer Notes field is not updated.

    3. And in the email template, we would like to display Customer Notes field, that will hold all the activities.

    Also, we create coverage team records by importing data from excel. In that case, the user does not open the Coverage team form/page and Save event does not get called. Therefore the Javascript that binds activities to Customer Notes field, do not get fired.

    Could you please provide some guidelines on how to achieve this. We would appreciate your help! Thank you for your time and inputs!

    Thursday, March 3, 2016 12:05 AM

All replies

  • If you are going with this approach, you will have to create a plugin with .Net code to perform the function in step 2.  I would create a custom action that runs called BuildCustomerNotes that returns an output parameter of your customer notes text.  You can use your plugin to populate that output parameter.  Your workflow should have following steps:

    1)  Call custom action BuildCustomerNotes

    2)  Update customer notes field w/ output from action

    3)  Send Email

    Thursday, March 3, 2016 7:00 AM
  • Thanks Chickscancode!  Appreciate your help and inputs. These inputs gave us the direction to think of plugin.

    We ended up using the plugin that is triggered in Create Message of entity to populate output parameter. and in the workflow, we added a wait condition to check if the field is populated. Thanks,


    Thursday, March 17, 2016 3:36 PM