【发布时间】:2016-05-30 20:51:23
【问题描述】:
我正在为 CFMAIL 编写自定义标签。我需要以不同于标准 CFMAIL 的方式处理某些电子邮件。我正在使用以下帖子作为起点 - http://www.cfhero.com/2011/11/creating-environment-safe-wrapper-for.html
之前
<cfmail to="no@example.com" from="no@test.com" subject="This is only a test">
<cfmailparam name="Importance" value="high">
hello world</cfmail>
自定义标签之后
<cf_email to="no@example.com" from="no@test.com" subject="This is only a test">
<cf_emailparam name="Importance" value="high">
hello world</cf_email>
自定义 CFMAIL 和 CFMAILPARAM 一切正常,但我的问题是如何处理“CFMAILPART”。在新标签中使用现有的 CFMAILPART 时,CF 会抛出错误。
<cf_email to="no@example.com" from="no@test.com" subject="This is only a test">
<cf_emailparam name="Importance" value="high">
<cfmailpart type="text">Text</cfmailpart>
<cfmailpart type="html">HTML</cfmailpart></cf_email>
详细信息:标记必须嵌套在 cfmail 标记内。
消息:标签 cfmailpart 的上下文验证错误。
我正在提出自己的想法,但找不到任何帮助文档。任何帮助或起点将不胜感激。
提前致谢。
【问题讨论】:
-
您使用的是什么版本的 ColdFusion?我看到代码是 2011 年的。这个人可能一直在 CF 9 上这样做
-
为
cfmail编写自定义标签的用例是什么?看起来你并没有真正做任何不同的事情。 -
对自定义标签说不。
-
我正在使用自定义标记点一些 CFMAIL 到第 3 方来处理点击率、丢弃等。我们有几十个 CFMAIL 实例,计划现在将一些实例移至第 3 方,然后最终再移一些。并非所有 CFMAIL 都会指向第 3 方,这就是我想使用 CFMAIL 和 CF_EMAIL 的原因。
标签: coldfusion cfmail