Create a mail message without sending from workflow and using template

Jawab Create a mail message without sending from workflow and using template

  • Thursday, January 03, 2013 1:56 AM
     
     

    How can i accomplish this task? In my workflow i want to create a mail message that stands in open tasks after case creation so the user have to send it manually before solving the case.

     

    When i try to configure the mail message i cannot choose from templates but i can only write my message.

     

    If i create a mail message instead of a mail message task (at this point the workflow sends directly the mail message) i can choose from templates.

All Replies

  • Thursday, January 03, 2013 2:53 AM
    Moderator
     
     

    This is the out of the box behavior. If choosing to create an email activity record, it won't attempt to send it by default but you don't have the option to choose a template. If you choose to send an email, the templates are available but the email is going to get sent right away.

    I think you accomplish what you are looking to do you would need a custom workflow activity that creates the email from the template programmatically but doesn't send it.


    Jason Lattimer
    My Blog -  Follow me on Twitter -  LinkedIn

  • Saturday, January 12, 2013 1:33 AM
     
     
    Can you indicate some code examples to accomplish that task?
  • Saturday, January 12, 2013 3:53 AM
     
     Answered

    You will need to use the InstantiateEmailTemplate message of the SDK to create an email activity using an existing pre-defined email template.

    The message will only return an email object you can then set the sender n receiver information and use service.create() to create an email activity that would be available to the users as open activity in CRM.

    HTH

    Sam


    Dynamics CRM MVP | Inogic | http://inogic.blogspot.com| news at inogic dot com

    If this post answers your question, please click "Mark As Answer" on the post and "Mark as Helpful"