{"id":281,"date":"2018-05-11T16:16:26","date_gmt":"2018-05-11T16:16:26","guid":{"rendered":"https:\/\/www.harepoint.com\/Blog\/?p=281"},"modified":"2020-04-08T09:54:15","modified_gmt":"2020-04-08T09:54:15","slug":"sharepoint-workflow-email-word-attachment","status":"publish","type":"post","link":"https:\/\/www.harepoint.com\/Blog\/sharepoint-workflow-email-word-attachment\/","title":{"rendered":"Add attachments using &#8220;Send E-mail with Word Document as a Body&#8221; SharePoint workflow action"},"content":{"rendered":"\n<p>HarePoint has recently announced a new workflow action &#8211; <b>Send E-mail with Word Document as a Body<\/b>. There is <a href=\"\/Blog\/sharepoint-workflow-email-word-body\/\">related article<\/a> about this action in our blog.<\/p><p>The idea was to easily create a document with complex formatting in Microsoft Word and then send an email based on this document. This workflow action has become so popular, that our customers even requested a feature: to be able to <b>add attachments<\/b> to such e-mails. HarePoint has added such functionality in <a href=\"\/Products\/HarePointWorkflowExtensions\/VersionHistory.aspx\">version v.2.12<\/a> of <a href=\"\/Products\/SharePoint-Workflows\/Default.aspx\">HarePoint Workflow Extensions<\/a>.<\/p>\n<p>Now, it can be done with the same workflow action &#8211; <b>Send E-mail with Word Document as a Body<\/b>, just a new (optional) parameter has been added \u2013 <b>an array of URLs<\/b> of documents to be attached:<\/p>\n<p><a href=\"\/Pictures\/Articles\/new_parameter_workflow_action.png\" data-rel=\"lightbox-image-0\" data-rl_title=\"\" data-rl_caption=\"\" title=\"\"><img decoding=\"async\" src=\"\/Pictures\/Articles\/new_parameter_workflow_action.png\" alt=\"New parameter in SharePoint workflow action\"><\/a><\/p>\n<p>You can see whole process of creating such a workflow in this video:\n<p><iframe loading=\"lazy\" width=\"560\" height=\"315\" src=\"https:\/\/www.youtube.com\/embed\/6_6mcVFpRmk\" frameborder=\"0\" allow=\"accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen><\/iframe>\n<p>Do not be confused with the fact that it needs an array, even if you intend to attach only a single document. There are several ways how an array with the URLs can be easily obtained or created:<\/p>\n<ul>\n    <li><b>Find List Item at URL<\/b> action from HarePoint Workflow Extensions pack \u2013 provides a very elegant way to obtain an array; you simply specify the criteria and it will automatically create an array with URLs of all documents matching that criteria. This array can be directly passed to <b>Send E-mail with Word Document as a Body<\/b> action.<\/li>\n    <li><b>Get List Item Attachments<\/b> \u2013 even if you have the needed files not as documents in a library, but as attachments to list items in SharePoint List, you can easily pull their URLs to an array using this action.<\/li>\n    <li><b>Create String Array<\/b> \u2013 when you need to attach just one few documents and you feel it\u2019s just easier to put in their URLs manually, you can do it with this action. Use a semicolon (;) to delimit URLs and thus the array items:<\/li>\n<\/ul>\n<p><img decoding=\"async\" src=\"\/Pictures\/Articles\/create_string_array.png\" alt=\"Create string array\"><\/p>\n<p>At HarePoint, we always consider that a product upgrade needs to be as safe and smooth as possible. Installing a new version of <b><a href=\"\/Products\/SharePoint-Workflows\/Default.aspx\">HarePoint Workflow Extensions<\/a><\/b> will not disrupt the functionality of workflows that use an older version of <b>Send E-mail with Word Document as a Body<\/b>. You don\u2019t even need to remove this action and add it again to get the new functionality, neither you need to re-publish the workflows; it will be automatically updated with the product upgrade.<\/p>\n<p>You can just keep the workflows as they are if you don\u2019t need to attach files to emails.<\/p>\n<p>On the other hand, if you need new functionality, the only thing you would need to do is to specify an array in the last parameter to add attachments, keeping all other parameters unchanged.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>HarePoint has recently announced a new workflow action &#8211; <b>Send E-mail with Word Document as a Body<\/b>. There is <a href=\"https:\/\/www.harepoint.com\/Products\/HarePointWorkflowExtensions\/Examples\/Workflow-Send-Email-With-Word-Document-Body.aspx\">related article<\/a> about this action in our blog. The idea was to easily create a document with complex formatting in Microsoft Word and then send an e-mail based on this document. This workflow action has become so popular, that our customers even requested a feature: to be able to add attachments to such e-mails.<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9],"tags":[14,25],"_links":{"self":[{"href":"https:\/\/www.harepoint.com\/Blog\/wp-json\/wp\/v2\/posts\/281"}],"collection":[{"href":"https:\/\/www.harepoint.com\/Blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.harepoint.com\/Blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.harepoint.com\/Blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.harepoint.com\/Blog\/wp-json\/wp\/v2\/comments?post=281"}],"version-history":[{"count":16,"href":"https:\/\/www.harepoint.com\/Blog\/wp-json\/wp\/v2\/posts\/281\/revisions"}],"predecessor-version":[{"id":1711,"href":"https:\/\/www.harepoint.com\/Blog\/wp-json\/wp\/v2\/posts\/281\/revisions\/1711"}],"wp:attachment":[{"href":"https:\/\/www.harepoint.com\/Blog\/wp-json\/wp\/v2\/media?parent=281"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.harepoint.com\/Blog\/wp-json\/wp\/v2\/categories?post=281"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.harepoint.com\/Blog\/wp-json\/wp\/v2\/tags?post=281"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}