From: "Les Mizzell" <[EMAIL PROTECTED]>
> I'm sorry, you may have to whack me in the head with a 2X4. Could you
> explain this in a little more detail please. Not sure I get it.
I'll try, but if I were left-handed I might have to use a 4x2.
>
> Let's take one template (this is for an travel insurance company):
> "payment_process.cfm". There's as many as 50 variables in there, and it
> does some complicate calculations to come up with the premium.
>
O.K. - template produces data.
> I've got no problem getting it to work when the form is submitted, *IF* I've
> got my <CFOUTPUT>s in the template itself. At this point though, I'm a
> little lost as to how to get this same template to be part of <CFMAIL>
> though, since
>
Your form, upon submit, needs to <cfoutput> the premium?
O.K. - although what you present makes the work flow of your
app hard to fathom.
> <CFMAIL.......>
> <cfinclude template="payment_process.cfm">
> </CFMAIL>
>
> can't have <CFOUTPUT>s inside.......
Well - that's not a prohibition I've seen CF enforce ....
O.K. With the <CFMAIL></CFMAIL> tag set you can have
literals and variables for the body text that gets sent.
I.E.,
<cfset addressee="Ms. Floridale Hummingbird">
<cfset amount="$1,000.00">
<cfset linefeed=chr(10) & chr(13)>
<CFMAIL ...
Dear #addressee#,#linefeed#
3linefeed#
Welcome to our program. #linefeed#
Your premium will be #amount#.#linefeed#
</CFMAIL>
You don't need any <cfoutputs> in the <cfmail> tags - the
variables will be evaluated along with the literals.
The above snippet will deliver mail with body-text equal
to:
///////////
Dear Ms. Floridale Hummingbird,
Welcome to our program.
Your premium will be $1,000.00
///////////
O.K.?
What I was suggessting was that as long as your include
(frex, payment_process.cfm) <cfset>s variable {amount}
then you can do
<cfinclude template="payment_process.cm">
<cfmail>
#amount#
</cfmail>
See? Then it doesn't matter if you have any <cfoutput>s
inside of payment_process.cfm. You could display the
output of the include and send email at the same time.
What I usually do with <cfmail> is concatenate all the elements
of each line before the <cfmail> and then code
<cfmail>
#line_1_text##linefeed#
#line_2_text##linefeed#
etc.
That way I can query a db and collect a set of pre-formatted
lines selected for the subject and recipient, insert vars
and then pump out the mail.
>
> Please bear with me....I actually starting to figure *SOME* of this out!
>
Me too.
Pan
------------------------------------------------------------------------------
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.