I ran into an issue where hyperlinks in workflow task emails where being automatically changed by SharePoint from absolute hyperlinks to relative ones.
Scenario:
- You create a custom Visual Studio workflow and use the CreateTask activity.
- You set your SPWorkflowTaskProperties.Description property to some HTML text.
- In your Description HTML text, you have an html hyperlink <a> tag whose href=”” attribute contains an absolute hyperlink to a resource in the same SharePoint farm (i.e. a list item).
- Example: “Please review <a href=”http://yourserver/site/lists/yourlist/dispform.aspx?ID=1”>contract #12345</a>”.
Goal:
Users will receive the task email, and be able to click on the absolute URL in the email body to navigate to the SharePoint resource.
Problem:
It appears that SharePoint parses this HTML and readjusts the hyperlink and makes it relative.
Example: “Please review <a href=”/lists/yourlist/dispform.aspx?ID=1”>contract #12345</a>”
This effectively breaks the hyperlink in the email client.
The only workaround was to get rid of the <a> tag and write out the hyperlink in full. For example:
“Please review contract #12345 (http://yourserver/site/lists/yourlist/dispform.aspx?ID=1)”.
In this manner, SharePoint did not adjust the hyperlink at all.
I am also having the same problem. Do you have a solution for this?