code in a database that gets executed at runtime from query output without
ever having the code written to a file. Wouldn't that be great? But if
that's possible, I sure haven't figured out how to do it yet.
A slightly kludgy workaround for the maximum flexibility you desire is to
use CFFILE to write the output of your textbox field to a file and then
CFINCLUDE the file inside your CFMAIL tag. Depending on how your
application will be used you can either make the filename always the same
or generate them dynamically (and you could even create a library of them
to use, selectable from a dropdown list or with radio buttons). To make
filenames dynamically so they'll never be overwritten, append a datetime in
the filename like EmailInc_2004527042533.cfm (which translates to 2004/5/27
04:25 and 33 hundredths of a second for example, so all your dynamically
created files will appear together and sorted properly in their
subdirectory by their datetime created, in a Name sort). After your
template writes the file just pass the filename down to your CFINCLUDE in
the CFMAIL. Instead of a datetime value you could also append a good-sized
random number, an incrementing value from a NextNumber table, whatever
works for you...
Regards,
Karl S.
At 02:50 PM 5/27/04, you wrote:
>Message: 4
> Date: Thu, 27 May 2004 13:19:21 -0700
> From: [EMAIL PROTECTED]
>Subject: CF-Mail merge application.
>
>I am hoping I can get some feedback on how difficult the following idea
>would be to implement and any hints on how to maybe done?
>
>This is for an e-mail distribution tool. We have a database that a user
>can create a customized list of records filtered by many different
>criteria of their choosing. The tool would then be used to send an e-mail
>to all the addresses in this generated list a message created by the user
>in the tool. Very straight forward to this point.
>
>How difficult would be to create a feature that would allow the user to
>pick one or more fields from the database related to the selected records
>and include this data in the message in a mail merge type function?
>
>For example the user could create a message something like this in a text box:
>#Fname# jumped over the candlestick.
>
>And the e-mails would be sent out something like this:
>email 1: Jack jumped over the candlestick.
>email 2: Jill jumped over the candlestick.
>email 3: Spot jumped over the candlestick.
>ect...
>
>What I can't picture yet is how I would process the input from a text box
>that contained "#Fname# jumped over the candlestick." and have the
>variable embedded in the string rendered into a value from the
>corresponding data. And not just output messages that look like this:
>email 1: #Fname# jumped over the candlestick.
>email 2: #Fname# jumped over the candlestick.
>email 3: #Fname# jumped over the candlestick.
>ect...
>
>That is what would happen if I just code the cfmail tag like this:
><cfmail ....>
> #Form.MailMessage#
></cfmail>
>
>Isn't it?
>
>
>--------------
>Ian Skinner
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

