使用 sharepoint 发送的邮件中 Outlook 中的 url 被阻止错误

发布于 2025-01-01 08:10:41 字数 1668 浏览 3 评论 0原文

我有一个 xml 数据,我正在使用 xsl 样式表对其进行转换以形成邮件正文的内容,并使用 SPUtility.SendEmail 方法发送邮件。我有两个链接,一个用于查看信息路径表单,另一个用于批准/拒绝任务表单。 infopath 表单链接在我的邮件中可以正常工作,但在另一封邮件中则不能。我在 Outlook Web 客户端中收到“出于安全原因阻止 URL”错误。

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

输出格式化链接是

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

当我在浏览器中复制并粘贴网址时,我收到提示“发生意外错误”,然后我将 & 替换为 &在浏览器中,我正确打开了表单。

这是 Outlook 的解析问题吗,但另一个包含 &amp; 的链接对我有用?

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&ID=</xsl:text>
        <xsl:value-of
            select="substring-before(/SRWorkflowDetails/SRLevel[level=$level and contains(Approver,$Id)]/URL,';')" 
            disable-output-escaping="yes"/>
        <xsl:text>&Source=http://stage/_layouts/WrkStat.aspx?List=089f13be%2D3147%2D4818%2Da30e%2Da332cb63195d&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&ID=35&Source=http://stage/_layouts/WrkStat.aspx?List=089f13be%2D3147%2D4818%2Da30e%2Da332cb63195d&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 & with & in the browser, i get my form opened correctly.

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

守不住的情 2025-01-08 08:10:41

尝试将disable-output-escaping添加到xsl:text元素:

<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&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">&Source=http://stage/_layouts/WrkStat.aspx?List=089f13be%2D3147%2D4818%2Da30e%2Da332cb63195d&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>

或者尝试删除xsl:text元素:

<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&ID=<xsl:value-of
        select="substring-before(/SRWorkflowDetails/SRLevel[level=$level and contains(Approver,$Id)]/URL,';')" 
        disable-output-escaping="yes"/>&Source=http://stage/_layouts/WrkStat.aspx?List=089f13be%2D3147%2D4818%2Da30e%2Da332cb63195d&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>

如果这些都不起作用,请尝试如何禁用输出转义属性?

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&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">&Source=http://stage/_layouts/WrkStat.aspx?List=089f13be%2D3147%2D4818%2Da30e%2Da332cb63195d&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&ID=<xsl:value-of
        select="substring-before(/SRWorkflowDetails/SRLevel[level=$level and contains(Approver,$Id)]/URL,';')" 
        disable-output-escaping="yes"/>&Source=http://stage/_layouts/WrkStat.aspx?List=089f13be%2D3147%2D4818%2Da30e%2Da332cb63195d&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?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文