Here is the answer I came up with a couple of years ago for a fanclub type
site.

In the form, I allowed the admin to enter designated text as a place holder
for things like firstname. So say I type the e-mail in the body as:

Hello _FNAME,

Have a good day. For your reference your fanclub id is _FCLUBID. Blah Blah
Blah

Thanks,

The Team

On the page that you send the info to, do a query for all of the emails you
are sending to, loop each one and do a replace on the body text with the
appropriate values. The only problem is that this isn't very dynamic (values
could change and your code would have to change too), but you could whip up
something that would cover almost anything you want to do. I already have
some good ideas, if I ever have to do it again.

Example:

<cfquery name="getcust" datasource="#datasource#" dbtype="ODBC">
select email, fname, lname from customer
</cfquery>
<cfloop query="getcust">
<cfset body = #ReReplaceNoCase('#form.message#', "_FNAME",
'#getcust.fname#', "ALL")#>
<cfset body = #ReReplaceNoCase('#body#', "_FCLUBID", '#getcust.lname#',
"ALL")#>
<cfmail query="getcust"
        to="#getcust.email#"
        [EMAIL PROTECTED]
        subject="#form.subject#">
#body#
</cfmail>
</cfloop>


Hope this helps,

Timothy Hill


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to