locked
attach an email to an email workflow. RRS feed

  • Question

  • Hi All,

    iS it possible to add an email attachment to an emai? Essentially, i want to be able to send an email using a workflow and attach to that email, another email. The scenario:

    when a customer sends an email into support@mycompany.com, it is picked up by CRM and entered into a queue. This will trigger an email workflow which will send an email to the support staff to let them know its there. I want to be able to attach the email that was received by the customer to this email generated by CRM.

    Is it possible programmatically? Or via a workflow?

    Thanks for your time! :-)

    Thursday, September 16, 2010 8:20 AM

Answers

  • CRM will only allow you to add files as attachments to an email. It may be possible to build a file from the email (at a guess it'd need a .eml extension), though I'm not sure if this works, or there are any further complexities with how the recipient's email client will interpret the file. If you did go down this route, I'd suggest creating a custom workflow activity that reads the body of the existing email, converts it to base64 encoding (which is how CRM stores file attachments) and add it as an email attachment
    Microsoft CRM MVP - http://mscrmuk.blogspot.com  http://www.excitation.co.uk
    Thursday, September 16, 2010 11:01 AM
    Moderator
  • in a perfect world - I would establish a self referential relationship for email, which would allow you to set the 'regarding' of the system generated email as the original email via workflow.
    However, I've just tried and it wont let you add a new N:1 relationship on the Email entity :(

    Workaround 1:

    Use the email entity as the basis for the workflow with all required check conditions you need. (Direction = incoming, to = support* etc)
    Next step: Send email, and poulate the body of the email, with the fields from the original. (basicially creating a forward, but text only)
    Ensure that in your initial check condition says something like (sender - does not equal - user/queue the forwarded email is sent from) otherwith you'll create a loop. 

     

    Workaround 2:

    Set up a forwarding rule on your exchange server  <-- I pick this as the easiest 


    ----------------------------------------------------- http://www.xtbase.com http://uk.linkedin.com/in/craighamer
    Thursday, September 16, 2010 12:48 PM

All replies

  • CRM will only allow you to add files as attachments to an email. It may be possible to build a file from the email (at a guess it'd need a .eml extension), though I'm not sure if this works, or there are any further complexities with how the recipient's email client will interpret the file. If you did go down this route, I'd suggest creating a custom workflow activity that reads the body of the existing email, converts it to base64 encoding (which is how CRM stores file attachments) and add it as an email attachment
    Microsoft CRM MVP - http://mscrmuk.blogspot.com  http://www.excitation.co.uk
    Thursday, September 16, 2010 11:01 AM
    Moderator
  • in a perfect world - I would establish a self referential relationship for email, which would allow you to set the 'regarding' of the system generated email as the original email via workflow.
    However, I've just tried and it wont let you add a new N:1 relationship on the Email entity :(

    Workaround 1:

    Use the email entity as the basis for the workflow with all required check conditions you need. (Direction = incoming, to = support* etc)
    Next step: Send email, and poulate the body of the email, with the fields from the original. (basicially creating a forward, but text only)
    Ensure that in your initial check condition says something like (sender - does not equal - user/queue the forwarded email is sent from) otherwith you'll create a loop. 

     

    Workaround 2:

    Set up a forwarding rule on your exchange server  <-- I pick this as the easiest 


    ----------------------------------------------------- http://www.xtbase.com http://uk.linkedin.com/in/craighamer
    Thursday, September 16, 2010 12:48 PM