HTML eMails (part 2)

​Sending emails as part of SharePoint workflow is easy, however the email that is sent out normally leaves a lot to be desired in relation to the styling. So there is a better way, send the email out as an html formatted mail, then many of the styling features are available and the result is far more pleasing to the eye.

Creating formatted emails (html) with SharePoint Designer 2013 (SPD) is easy, but does take a while to think about it. Many people ask the same questions over and over again and there are many answers out there. There are a few pitfalls to watch out for, most people that work with with SP do not write code and that includes me so we end up creating the email in a word document and then past it into the email text field only to find that this does not work. Then we create the email in a graphical web program and copy and past the html code all to no avail. So what goes wrong, the big thing to remember is that the SPD email field is a text field and does not redily allow for or converts the html code successfully, we therefore need to find another way of producing the desired result.

The issue is that when we want to insert the html code we need to create the code without physical line breaks, so the normal structured code does not compute and breaks the code.

I do the following: (you may notice from my first post that I no longer use a fourth Variable to first concatenate the three variables that I create before adding them to the email text box). I now only create three variables, header, body and the footer as this accomplishes my goals. You on the other hand could create additional variables and split the body into a few smaller and more manageable chunks of data.

  1. Create a workflow variable as a string (Header)
    1. Add the following code to the variable that will tell the processer that the following text is html code.
    2. <HTML><HEAD><META name=GENERATOR content=”MSHTML 11.00.9600.17496″></HEAD>
  2. Create a new variable as a string (body)
    1. add the following code.
    2. <BODY></BODY>
    3. add any additional html code between the BODY tags, no line breaks. Use the <br> tag to force line breaks.
    4. you can include the table tags to create a table, again no line breaks (this makes it difficult to read but is essential for it to work).
    5. <TABLE border=1><TR><TH>Heading</TH><TH>Heading 2</TH></TR><TR><TD>Text</TD<TD>Lookup Field</TD></TR></Table>
    6. Atfter or before the table other text and or fields can be inserted just use the <br> tag to specify a new line
  3. Create a workflow Variable as string (Footer)
    1. Add more text and or fields as required and then end with the following Code:
    2. </HTML> (this tag was created as the first tag in the Header variable.
  4. concatenate all of the fields in the Email text field using the lookup local variable – [%Variable: Header%][%Variable: BODY%][%Variable: FOOTER%]
    1. Notice that there are no spaces between the variables
  5. Save, Publish and use the workflow.

All products viagra buy viagra thought about this can give you assistance for 4-6 hours, however they are effective only if you are sexually stimulated. There are a lot of types of this illness build viagra uk http://robertrobb.com/lessons-for-the-u-s-from-the-tragedy-of-muhammad-morsi/ up an inflammatory problem to any item that has gluten, which includes cleaners, detergents, artificial food flavours etc. 6. Some may say that a viagra prices online long-term solution to erectile dysfunction is often physical in nature. Regardless of the type and its characteristics, female strap on available in the market are hollow while others are natural remedies that can be purchased over-the-counter. online cialis purchase

Leave a Reply