Contour for Umbraco 带有一个工作流选项,可让您在用户提交表单后发送带有应用 XSLT 文件的电子邮件。
它带有这个示例:
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:msxsl="urn:schemas-microsoft-com:xslt"
xmlns:user="urn:my-scripts"
xmlns:umbraco.library="urn:umbraco.library"
exclude-result-prefixes="xsl msxsl user umbraco.library">
<xsl:output method="html" media-type="text/html" doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN"
doctype-system="DTD/xhtml1-strict.dtd"
cdata-section-elements="script style"
indent="yes"
encoding="utf-8"/>
<xsl:param name="records" />
<xsl:template match="/">
<h3>Intro</h3>
<p>
Hello, this is a sample email using xslt to convert a record into a custom email
</p>
<h3>the fields</h3>
<ul>
<xsl:for-each select="$records//fields/child::*">
<li>
<h4>
Caption: <xsl:value-of select="./caption"/>
</h4>
<p>
<xsl:value-of select=".//value"/>
</p>
</li>
</xsl:for-each>
</ul>
<h3>The actual xml</h3>
<xsl:copy-of select="$records"/>
</xsl:template>
</xsl:stylesheet>
其中一个表单字段是 CV 的文件上传字段
理想情况下,如果我可以输出正确的链接,我会喜欢它。
字段名称是“上传简历”,目前类似这样的内容在它发送的电子邮件中作为简单的文本输出:
'/umbraco/plugins/umbracoContour/files/e105a66a-7478-4f95-95ad-d4da3190c6ce/d9e0087e-733b-4b4d-9b54-41d4aa979c11/mycv.pdf'
我怎样才能重新调整这个 xslt,以便当它遇到“上传简历”字段时,它会创建一个超链接,而不仅仅是原始文本。
超链接的 href 最终将类似于:
“http://www.example.com/umbraco/plugins/umbracoContour/files/e105a66a-7478-4f95-95ad-d4da3190c6ce/d9e0087e-733b-4b4d-9b54-41d4aa979c11/mycv.pdf”