1

I have an xml data that I am transforming using xsl stylesheet to form content of the mail body, and I use the SPUtility.SendEmail method to send the mail. I have two links, one to view an infopath form and another to approve/reject task form. The infopath form link works properly in my mail but not the other one. I get the "url is blocked for security" error in Outlook web client.

<a title="Approve/Reject" style="color:#b94e0a;text-decoration:underline;">
    <xsl:attribute name="href">
        <xsl:text>http:/stage/_layouts/WrkTaskIP.aspx?List=91be5c14%2D6eea%2D4223%2D802e%2D7fa28b5d14ba&amp;ID=</xsl:text>
        <xsl:value-of
            select="substring-before(/SRWorkflowDetails/SRLevel[level=$level and contains(Approver,$Id)]/URL,';')" 
            disable-output-escaping="yes"/>
        <xsl:text>&amp;Source=http://stage/_layouts/WrkStat.aspx?List=089f13be%2D3147%2D4818%2Da30e%2Da332cb63195d&amp;WorkflowInstanceID=</xsl:text>
        <xsl:value-of
            select="substring-after(/SRWorkflowDetails/SRLevel[level=$level and contains(Approver,$Id)]/URL,';')"
            disable-output-escaping="yes"/>
    </xsl:attribute>
    Approve/Reject
</a>

The output formatted link is

<a
    title="Approve/Reject"
    style="color:#b94e0a;text-decoration:underline;"
    href="http:/stage/_layouts/WrkTaskIP.aspx?List=91be5c14%2D6eea%2D4223%2D802e%2D7fa28b5d14ba&amp;ID=35&amp;Source=http://stage/_layouts/WrkStat.aspx?List=089f13be%2D3147%2D4818%2Da30e%2Da332cb63195d&amp;WorkflowInstanceID=11e09c76-29ec-4c7f-ace3-ad7a8c9e7b44">
    Approve/Reject
</a>

When i copy and paste the url in browser i get a prompt saying "unexpected error has occurred", then i replace the &amp; with & in the browser, i get my form opened correctly.

Is this any parsing issue with outlook, but the other link which has &amp; is working for me??

Rich Bennema
  • 10,295
  • 4
  • 37
  • 58
Shankar
  • 448
  • 3
  • 9
  • 34

1 Answers1

0

Try adding disable-output-escaping to the xsl:text elements:

<a title="Approve/Reject" style="color:#b94e0a;text-decoration:underline;">
    <xsl:attribute name="href">
    <xsl:text disable-output-escaping="yes">http:/stage/_layouts/WrkTaskIP.aspx?List=91be5c14%2D6eea%2D4223%2D802e%2D7fa28b5d14ba&amp;ID=</xsl:text>
    <xsl:value-of
        select="substring-before(/SRWorkflowDetails/SRLevel[level=$level and contains(Approver,$Id)]/URL,';')" 
        disable-output-escaping="yes"/>
    <xsl:text disable-output-escaping="yes">&amp;Source=http://stage/_layouts/WrkStat.aspx?List=089f13be%2D3147%2D4818%2Da30e%2Da332cb63195d&amp;WorkflowInstanceID=</xsl:text>
    <xsl:value-of
        select="substring-after(/SRWorkflowDetails/SRLevel[level=$level and contains(Approver,$Id)]/URL,';')"
        disable-output-escaping="yes"/>
    </xsl:attribute>
    Approve/Reject
</a>

Or try doing away with the xsl:text elements:

<a title="Approve/Reject" style="color:#b94e0a;text-decoration:underline;">
    <xsl:attribute name="href">
    http:/stage/_layouts/WrkTaskIP.aspx?List=91be5c14%2D6eea%2D4223%2D802e%2D7fa28b5d14ba&amp;ID=<xsl:value-of
        select="substring-before(/SRWorkflowDetails/SRLevel[level=$level and contains(Approver,$Id)]/URL,';')" 
        disable-output-escaping="yes"/>&amp;Source=http://stage/_layouts/WrkStat.aspx?List=089f13be%2D3147%2D4818%2Da30e%2Da332cb63195d&amp;WorkflowInstanceID=<xsl:value-of
        select="substring-after(/SRWorkflowDetails/SRLevel[level=$level and contains(Approver,$Id)]/URL,';')"
        disable-output-escaping="yes"/>
    </xsl:attribute>
    Approve/Reject
</a>

If neither of those work, try the workaround described in How to disable output escaping for an attribute?

Community
  • 1
  • 1
Rich Bennema
  • 10,295
  • 4
  • 37
  • 58
  • thanks! let me try this... and i dont have any problem if i use the desktop outlook client app. The link works fine there but not with outlook web client. – Shankar Feb 02 '12 at 04:31