Building a Hyperlink in an Email with SharePoint Designer
Guest Author: Jim Bob Howard
For folks very new to SharePoint—and possibly HTML, I wanted to share a quick tip sending a link to a SharePoint item via email.
I’ll assume you either know how (or can look up on EndUserSharePoint.com) how to launch SharePoint Designer (SPD) and create a workflow. So, let’s start with adding the Send an Email action:
- Choose Send an Email from the Actions menu
- Click on "this message"
- In the body of the message, we want to add a link where the ‘[ ]‘ is located
- Replace the ‘[ ]‘ with ‘<a href=""></a>’ (without the single quotes)
- Point your browser to an item in your list (we’re going to copy and paste the URL here)
- Highlight the URL in your browser
- Press Ctrl-C to copy the URL
- Toggle back to SPD and paste (Ctrl-V) the URL between the double quotes
- Highlight the ‘1′ at the end of the text you just pasted in
- Click Add Lookup to Body
- In the Field dropdown, choose ID, and click OK
- The next step is to put text inside the anchor tag (<a href="…"></a>). That’s what will be clickable in the email. I suggest using the Title field.
- Place your cursor just to the left of </a> and click Add Lookup to Body again
- This time, choose Title in the Field dropdown.
- Click OK
- Add any other steps and actions you choose to the workflow and click Finish

Click ‘this message’ to configure the email

Screen clipping taken: 12/15/2009, 1:52 PM

Highlight the URL in your browser

In your case, ’site,’ ’subsite,’ and ‘listname’ will be replaced by an address specific to your site.

The ‘1′ at the end of the URL was highlighted before clicking Add Lookup to Body

Add text for the user to click on
Now, whenever a new item is created, the person who created it will receive a link to that specific item via email.
If you would prefer that they are taken to the item page in edit mode, simply replace DispForm.aspx with EditForm.aspx in the text you pasted in Step 7.

Jim Bob Howard
Jim Bob Howard is a web designer / web master in the healthcare industry. He has been working with SharePoint only since March 2009 and enjoys sharing what he has learned. You can email him at jimbobhoward@gmail.com.





Wow, simple HTML like we learned it 15 years ago! ;-)
True. But “we” didn’t all learn it 15 years ago. ;)
I agree with you! :-) And godd for those, who didn´t know how it works! Thanks!
This does not work if the URL has spaces in it. For example if I’m embedding the user name(FirstName Last Name) dynamically then it comes as FirstNameLast Name in the URL, there is no space between the FirstName Last Name.
Sanjay,
I’m not quite sure what you mean by “embedding” the user name.
If you are passing it as a querystring, and pulling the First Name and Last Name from your list item, then you can add a space by simply inserting “%20″ between the two fields when you build the URL.
If that’s not what you mean, comment again and I’ll try to answer your specific dilemma.
Blessings,
Jim Bob
Hi Jim,
Thanks for responding.. I cannot user “%20″ because my query strings comes dynamically(i.e. workflow variables). I will explain here to make this more clear:
I will have the hyperlink in my SPD workflow email body as follows but query string values will come dynamically
click here
When user gets this in email, the link comes as follows:
https://outlook.servername/owa/redir.aspx?C=da8c5df0fcc746f98145fffc467d0701&URL=https%3a%2f%2fservername%2ftest.aspx%3fQS1%3dtest%0user1%26QS2%3dtest+user2
If you observe here in above link, th first space between test and user1 has been converted into “%0d%0″
Now when user click on this, the browser converts this to
https://servername/test.aspx?QS1=testuser1&QS2=test+user2
So it removed the space between test and user1 for QS1 but QS2 works fine.
Sanjay,
Where are the workflow variables coming from? Are you sure you’re not getting ‘%0d%0a’? That would be a carriage return/line feed. If it’s coming a column, we might be able to strip those out and replace them with a true space, or %20.
Blessings,
Jim Bob
Its a workflow variable set to user name using a custom workflow action..
As this problem comes only for 1st query string variable. I did a workaround by making first query string variable as a dummy variable with space thenmy real query strings ..it worked fine.
I think its a SPD workflow bug ..I saw some more query related to this in MSDN discussion fourms as well.
Thanks for your help Jim ..
Hi,
I have added a link in the email content, to open a word document, when the user gets the mail. When the user clicks on the link, the user gets the username and password prompt. I want to disable user prompt while opening document.
How to achieve this?
Thank you
Dear Venkatesh,
I’m assuming this is a system-specific issue to your organization and/or the document they’re trying to open. If they’re not logged in to SharePoint (assuming the doc resides in a Document Library on SP), they may get that login prompt. Or, if there is some security system set up that prompts more regularly, that may be the culprit as well.
Hope that helps (and sorry I couldn’t help more).
Blessings,
Jim Bob