Skip to main content
Face Icon

Ben the SharePoint Hobbyist Blog

Go Search
  

Other Blogs
There are no items in this list.
Team Web Site > Public > Ben the SharePoint Hobbyist Blog > Posts > Create Custom E-mail Alert Templates for SharePoint Workflows
Create Custom E-mail Alert Templates for SharePoint Workflows
UPDATE: For whatever reason, the mdb file I had uploaded wouldn't work.  I zipped up the file and the new link is reflected below.  Thanks to Itay for pointing this out to me!
 
I really like how easy it is to create alerts in SharePoint Designer 2007, but I found a few aspects of it's "send e-mail" feature rather annoying:
  • Every carriage return in the alerts is processed as a <BR> or a <P> (HTML code) when the e-mail is sent.  This looks really bad.
  • You can add style sheets to the e-mail, but because of the above problem, you have to create it as if it were a single line without line breaks.  This is annoying.
  • You can't copy the entire contents of an e-mail that has workflow lookups inserted to the body.  This makes for a tough process of trying to copy code from one e-mail body to another.

I wasn't content with plain text e-mail alerts, so I copied the HTML out of one of SharePoint's default alerts and used that as a starting point.  I cut up the contents of the file and put snippets of code in a Microsoft Access Database.  I then made a form that helps generate the final formatting of the e-mail alert.  You can insert "placeholders" for where you intend to add workflow data lookups to your e-mail alert.  After you specify what fields you want, you can preview the alert in Internet Explorer (sorry Firefox users) and copy the code (without line breaks) that you'll need to paste into SharePoint Designer.  Here's a look at what the application looks like:

Alert Creator

Check out what a "Preview Alert" looks like:

The idea is that you let the application create the code for you and then you copy the code and paste that line into SharePoint Designer.  If you added lookup placeholders to your code, you then go through and delete the placeholders and put the actual lookup in its place.  Here's what SharePoint Designer looks like after you've added the lookups to your code:

SharePoint Designer E-mail Alert

I've included a link the the Access application below, but you should note a few things:

  • The file is available as is with no warranties or support, expressed or implied.
  • The preview is set up to work only with Internet Explorer (unless someone wants to write a module for me that calls the application for the default Windows browser).
  • You'll need to manually copy the contents of the box at the top of the window.  The contents of this box are generated when you click "Process Alert!"
  • After copying the code into SharePoint designer, you'll need to replace the placeholders with actual lookups.

I'm open to comments and suggestions regarding this tool, but I can't promise to be able to support it.  I'll try to fix bugs if I have time.

Download it here:

Comments

Link doesn't work

looks nice tought..
at 11/14/2007 10:53 AM

PingBack from http://drewmace.blogspot.com/2007/11/create-custom-e-mail-alert-templates.html

Ben - Good article - thanks for the utility.  This will help many developers in completing the branding of their site.
at 11/21/2007 11:58 AM

Thanks!

And Pingback in www.sharepoint2007.co.cc
at 11/30/2007 12:15 PM