1,434 articles and 9,784 comments as of Thursday, March 11th, 2010

Tuesday, December 22, 2009

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:

    1. Choose Send an Email from the Actions menu
    2. Click on "this message"

    3. Click ‘this message’ to configure the email

    4. In the body of the message, we want to add a link where the ‘[ ]‘ is located
    5. Replace the ‘[ ]‘ with ‘<a href=""></a>’ (without the single quotes)

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

    7. Point your browser to an item in your list (we’re going to copy and paste the URL here)
    8. Highlight the URL in your browser

    9. Highlight the URL in your browser

    10. Press Ctrl-C to copy the URL
    11. Toggle back to SPD and paste (Ctrl-V) the URL between the double quotes

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

    13. Highlight the ‘1′ at the end of the text you just pasted in
    14. Click Add Lookup to Body
    15. In the Field dropdown, choose ID, and click OK

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

    17. 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.
    18. Place your cursor just to the left of </a> and click Add Lookup to Body again
    19. This time, choose Title in the Field dropdown.

    20. Add text for the user to click on

    21. Click OK
    22. Add any other steps and actions you choose to the workflow and click Finish

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

Guest Author: 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.

 

Please Join the Discussion

14 Responses to “Building a Hyperlink in an Email with SharePoint Designer”
  1. Donnie Darko says:

    Wow, simple HTML like we learned it 15 years ago! ;-)

  2. True. But “we” didn’t all learn it 15 years ago. ;)

  3. Donnie Darko says:

    I agree with you! :-) And godd for those, who didn´t know how it works! Thanks!

  4. Sanjay says:

    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.

  5. 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

  6. Sanjay says:

    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.

  7. 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

  8. sanjay says:

    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 ..

  9. Venkatesh says:

    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

  10. 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

Trackbacks

Check out what others are saying about this post...
  1. Microsoft Banned from Selling Versions of Word; Obama Cyber Czar Choice Worries About Smartphones; Email Best Collaboration Tool?…

    Top News Stories Best Collaboration Tool: Email (Life Hacker) Last week we asked you to share your favorite…

  2. [...] Step 1. Since our Injury Report is a list that can execute a workflow, it’s easy to send an email to the user that includes a link to the BPE survey NewForm.aspx. But we also want to pass the ID of the Injury Report to the BPE survey and we can do that through the querystring. All we have to do is add "?ReportID=" and the Current Item’s ID field to the anchor tag’s HREF. (e.g. http://{site}/{subsite}/Lists/BPESurvey/NewForm.aspx?ReportID={ID}. If this isn’t clear, see my separate post on Building a Hyperlink in an Email in SPD.) [...]

  3. [...] Building a Hyperlink in an Email with SharePoint Designer [...]

  4. SharePoint Kaffeetasse 147…

    Office 2010 Video: Neuerungen in PowerPoint 2010, Teil 1 Video: PowerPoint 2010 Demo Teil 2 – PowerPoint…




Notify me of comments to this article:


Speak and you will be heard.

We check comments hourly.
If you want a pic to show with your comment, go get a gravatar!