{"id":3401,"date":"2016-08-03T17:27:42","date_gmt":"2016-08-03T11:57:42","guid":{"rendered":"https:\/\/www.inogic.com\/blog\/?p=3401"},"modified":"2016-08-03T17:27:42","modified_gmt":"2016-08-03T11:57:42","slug":"set-email-signature-using-workflow-in-dynamics-crm-2016-update-1","status":"publish","type":"post","link":"https:\/\/www.inogic.com\/blog\/2016\/08\/set-email-signature-using-workflow-in-dynamics-crm-2016-update-1\/","title":{"rendered":"Set Email Signature using Workflow in Dynamics CRM 2016 Update 1"},"content":{"rendered":"<p><strong>Introduction:<\/strong><\/p>\n<p>Email signature is an\u00a0integral part of every email that we exchange. It adds a professional touch to our Emails. Microsoft Dynamics CRM 2016 Update 1 introduced Email Signature as an out of the box entity. \u00a0So that user can save time and be consistent in response. Previously, to add signatures in their emails user needed to perform some customizations. With the release of Dynamics CRM 2016, now user can insert signature in email using OOB functionality. You may refer this <a href=\"https:\/\/www.inogic.com\/blog\/2016\/06\/insert-signature-in-dynamics-crm-2016-update-1-email-an-oob-functionality\/\" target=\"_blank\" rel=\"noopener noreferrer\">blog<\/a> in order to know how to insert signature to emails in Dynamics CRM using OOB functionality.\u00a0<a href=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2016\/08\/Email-Signature-using-Workflow-1.png\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-3402\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2016\/08\/Email-Signature-using-Workflow-1.png\" alt=\"Email Signature using Workflow\" width=\"601\" height=\"302\" \/><\/a><\/p>\n<p>However,when you create an Email using \u201cSend Email\u201d step in the OOB Workflow there is no option of \u201cInsert Signature\u201d.<\/p>\n<p>Below is the snippet of the code to do it programmatically using C# code:<\/p>\n<p>For this we need to create workflow Assembly which will give Email Signature as an Output Parameter.<\/p>\n<pre class=\"lang:default decode:true \">\/\/Creating Output parameter\n[Output(\"EmailSignature\")]\npublic OutArgument&lt;string&gt; EmailSignature { get; set; }\n<\/pre>\n<p>Here we have used the hardcoded email signature record id from CRM.<\/p>\n<p>You can get email signature record id as shown below<a href=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2016\/08\/Email-Signature-using-Workflow-2.png\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-3403\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2016\/08\/Email-Signature-using-Workflow-2.png\" alt=\"Email Signature using Workflow\" width=\"624\" height=\"242\" \/><\/a><\/p>\n<p>Then we will retrieve the Email Signature record which we want to use.<\/p>\n<p>Entity emailSignature =_service.Retrieve(&#8220;emailsignature&#8221;, new\u00a0Guid(&#8220;AA8DD4EE-6D58-E611-80F4-C4346BDC5EB1&#8221;), newColumnSet(&#8220;presentationxml&#8221;));<\/p>\n<p>The Email Signature record contains \u201cPresentationXml\u201d field which stores XML data for the body of the email signature.<\/p>\n<p>Read the \u201cpresentation XML\u201d from result and retrieve inner text of \u201cemailsignature\/presentationxml\u201d node which contains the email signature.<\/p>\n<pre class=\"lang:default decode:true \">XmlDocument doc = new XmlDocument();\nstring emailSignatureValue= string.Empty;\n\/\/Check whether the field contains value\nif (emailSignature.Attributes.Contains(\"presentationxml\") &amp;&amp; emailSignature[\"presentationxml\"] != null)\n{\n   doc.LoadXml(Convert.ToString(emailSignature[\"presentationxml\"]));\n  emailSignatureValue  = doc.SelectSingleNode(\"emailsignature\/presentationxml\").InnerText;\n}\nif (!string.IsNullOrEmpty(emailSignatureValue))\n{\n  EmailSignature.Set(executionContext, emailSignatureValue);\n}\n<\/pre>\n<p>Use this value to set the Signature in email body by appending it after the desired content as shown in below screenshot.<\/p>\n<p><a href=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2016\/08\/Signature-in-email-body-3.png\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-3404\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2016\/08\/Signature-in-email-body-3.png\" alt=\"Signature in email body \" width=\"696\" height=\"269\" \/><\/a><a href=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2016\/08\/signature-using-workflow-4.png\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-3405\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2016\/08\/signature-using-workflow-4.png\" alt=\"signature using workflow\" width=\"601\" height=\"323\" \/><\/a><\/p>\n<p><strong>Conclusion:<\/strong><\/p>\n<p>Using this method,\u00a0you can set an Email Signature using Workflow in Microsoft Dynamics CRM 2016 Update 1.<\/p>\n<p>Before you move on to the next post, Check out what&#8217;s there in <a href=\"http:\/\/bit.ly\/maplytics-august-release\" target=\"_blank\" rel=\"noopener noreferrer\">Maplytics August Release<\/a>!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Introduction: Email signature is an\u00a0integral part of every email that we exchange. It adds a professional touch to our Emails. Microsoft Dynamics CRM 2016 Update 1 introduced Email Signature as an out of the box entity. \u00a0So that user can save time and be consistent in response. Previously, to add signatures in their emails user\u2026 <span class=\"read-more\"><a href=\"https:\/\/www.inogic.com\/blog\/2016\/08\/set-email-signature-using-workflow-in-dynamics-crm-2016-update-1\/\">Read More &raquo;<\/a><\/span><\/p>\n","protected":false},"author":13,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[25,67],"tags":[726,727],"class_list":["post-3401","post","type-post","status-publish","format-standard","hentry","category-dynamics-crm-2016-update-1","category-workflows","tag-email-signature-using-workflow","tag-email-signatures-dynamics-crm-2016"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/posts\/3401","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/users\/13"}],"replies":[{"embeddable":true,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/comments?post=3401"}],"version-history":[{"count":0,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/posts\/3401\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/media?parent=3401"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/categories?post=3401"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/tags?post=3401"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}