I didn't test it, but try something like:
<cfsilent>
<!--- No need for an end tag --->
<cfif NOT compareNoCase(thisTag.executionMode, "end")>
<cfexit method="exitTag">
</cfif>
<!--- Required attributes --->
<cfparam name="attributes.to">
<!--- Default attributes --->
<cfparam name="attributes.from" default="[email protected]">
<cfparam name="attributes.subject" default="Default Subject">
<cfparam name="attributes.type" default="HTML">
<!--- Send email --->
<!--- CF 8 or later version could be: <cfmail
attributeCollection="#attributes#"> --->
<cfmail from="#attributes.from#" to="#trim(attributes.to)#"
subject="#attributes.subject#" type="#attributes.type#">
<div style="padding:20px; margin:20px; border:2px solid blue;">
#trim(thisTag.generatedContent)#
</div>
</cfmail>
<!--- Kill the output --->
<cfset thisTag.generatedContent = "">
</cfsilent>
--
Brad Roberts
AgentBlaze, LLC
Office: (865) 681-8390
Fax: (866) 583-9334
[email protected]
http://www.agentblaze.com
On Wed, Nov 4, 2009 at 1:25 PM, Michael Muller <[email protected]>wrote:
>
> Hey all
>
> I'm trying to make a custom tag for cfmail so I can create a standard From,
> Subject, and HTML layout inside the email that is sent.
>
> I have created the tag and am using the open / close method, but the
> content of the email winds up being displayed on the page, as well as being
> emailed. I'm using THIS.generatedContent inside the custom tag in the body
> of the cfmail tag, and have even tried wrapping the tag inside a cfsilent.
>
> What am I missing? How do I stop the body of the custom tag from
> displaying, or is that not possible.
>
> Mik
>
>
> <cf_mailsend to="[email protected]">yadda yadda</cf_mailsend>
>
> ====
>
> <cfsilent>
> <cfswitch expression="#thisTag.ExecutionMode#">
>
> <cfcase value="start">
> <cfparam name="attributes.to" default="">
> </cfcase>
>
> <cfcase value="end">
> <cfmail to="#trim(attributes.to)#" subject="subject" from="
> [email protected]" type="HTML">
> <div style="padding:20px; margin:20px; border:2px solid blue;">
> #trim(thistag.generatedcontent)#
> </div>
> </cfmail>
> </cfcase>
>
> </cfswitch>
> <cfsilent>
>
>
> --------
> Michael Muller
> office (413) 863-6455
> cell (413) 320-5336
> skype: michaelBmuller
> http://MontagueWebWorks.com
>
> Information is not knowledge
> Knowlege is not wisdom
>
> Eschew Obfuscation
>
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Want to reach the ColdFusion community with something they want? Let them know
on the House of Fusion mailing lists
Archive:
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:328050
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4