Tuesday, March 15, 2016

Adding images to SPD Workflow emails

I work in an organisation where there are a few managers that are afraid of technology which is not directly related to SharePoint Online (or any version). I bare this in mind when I designed a Workflow for a Document Management System (which is a document library with various content types). To start I renamed the “Created By” column to “Owner”.

After the Owner uploads a document and the “Approval Status” is “Draft” an email is sent to them. To make things more user friendly, I added a link in the email that points to the document library. I felt that it would help the user even more if I there was an image showing how to “Publish a Major Version” through the item’s ellipses menus. I did this by accessing the Properties… button of the “Email Current Item: Owner” action as shown below in Figure 1. This is not the Define E-mail Message window where you get to define the “To:”, “CC:”, “Subject:” fields and type the email message though the properties can give you the same options.

Figure 1: Valid stage that sends an email

Once you access the “Send an Email Properties” windows you’ll see the various properties of the email but we are interested in the “Body” property as shown below in Figure 2.

Figure 2: Send an Email Properties

Now, Click the ellipsis of the body field to review the string builder as shown below in Figure 3. This view is not quit user friendly if you are not used to starring at code. Best thing is not to play around with the tags already there. I just inserted an image tag where I want the image to be display.

Figure 3: Email String Builder

 

The code I used to insert an image is as follows… “<IMG alt="Publish a Major Version" src="https://sitecollection/sites/subsite/screenshots/screenshot-publish_a_major_version.jpg">”. In my case the image is stored in an image library on the same SharePoint site. You can insert images from any location as long as your user base has access to where the image is stored. I didn't use any more image attributes as it wasn't necessary. If you wish, you can find out more information about the <IMG> tag attributes here - http://ift.tt/17mUPMx.

As far as images are concerned, I did try an animated GIF that shows the different clicks, i.e. Click the Document's ellipsis > Preview ellipsis > Advanced > "Publish a Major Version". There is one problem, not every email client supports animated GIFs. Newer versions of Outlook (2007, 2010 and 2013) won’t show the animation. All other image formats are accepted when building in SharePoint Designer and by all other email clients. You can find out more about email client support here - http://ift.tt/1r1gp4E.

You can use animated GIFs if your users view their emails in email clients that can show animated GIFs. The final email will have some text and the image inserted earlier. In my case, the email will look something like the email in figure 4.

Figure 4: The email received with an image inserted via a workflow

That's it you're done. When a user receives the email created earlier, they will see the image inserted in the body of the email.  If they view animated gifs, well that's even better.


by Larry Saytee via Everyone's Blog Posts - SharePoint Community

No comments:

Post a Comment