Either way would work, I just prefer the replace as I can do more than just
what existed inside a Query.



-----Original Message-----
From: Nick Sweeney [mailto:[EMAIL PROTECTED] 
Sent: 26 October 2005 21:33
To: CF-Newbie
Subject: RE: CFMail Functionality

Thanks Everybody!

Jenny and Mike: What you were suggesting was what I was using originally.
And while that does work very well, it didn't work for what I was trying to
do, which was to send multiple personalized emails from saved HTML in the
database. (The CF tags would be saved in the HTML and are not read when
stripped in the CFMail query.)

However, Neil - Your suggestion worked very well.

Thanks again Everyone!

- Nick

Here's is the code I am using:

<cfif IsDefined("FORM.SendCamp") AND FORM.SendCamp EQ "Sent">
<!---
Loop Over Email Subscribers
Designated to Receive Email Campaign
 --->
<cfloop query="qryGetEmailSubs">
        <!--- If Email is Personalized with Firstname - Replace Firstname in
Email
Message --->
        <cfset MessageTextAmended1 = ReplaceNoCase(#qryGetEmail.EMMessage#,
"[FIRSTNAME]","#qryGetEmailSubs.FirstName#",  "All")>
        <!--- If Email is Personalized with Lastname - Replace Lastname in
Email
Message --->
        <cfset MessageTextAmended2 = ReplaceNoCase(#MessageTextAmended1#,
"[LASTNAME]","#qryGetEmailSubs.LastName#",  "All")>
                <!--- Now Send Designated Email Message --->
                <CFMAIL
                type="html"
                SUBJECT="#qryGetEmailCamps.ECTitle#"
                FROM="[EMAIL PROTECTED]"
                TO="#qryGetEmailSubs.Email#">
                        #MessageTextAmended2#
                                        <br>
                                        <hr>
                                        <br>
                                        <font face="Arial, Helvetica,
sans-serif" size="-2">
                                        &copy; #year(NOW())#
#qryGetClient.Name# - All rights reserved.<br>
                                        #qryGetClient.Address1#,
#qryGetClient.City#, #qryGetClient.State#
#qryGetClient.Zip#
                                        <br><br>
                                        <a href="#qryGetClient.WebAddress#"
class="footer">#qryGetClient.WebAddress#</a><br>
                                        <br>

                                        This email was sent to
#qryGetEmailSubs.Email#.<br>
                                        If you feel you have received this
email by mistake or would like to be
removed from our mailing list, please contact us at <a
href="mailto:#qryGetClient.Email#"; class="footer">#qryGetClient.Email#</a>.
                                        </font>
                </CFMAIL>
</cfloop>
                <!--- Now update the sent date --->
                        <cfset Sent = "#Now()#">
                        <cfquery datasource="#datasource#"
username="#username#"
password="#password#">
                        Update EmailCampaign Set DateSent = #Sent#
                        WHERE ECID = #qryGetEmailCamps.ECID#
                        </cfquery>

</cfif>




~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Discover CFTicket - The leading ColdFusion Help Desk and Trouble 
Ticket application

http://www.houseoffusion.com/banners/view.cfm?bannerid=48

Message: http://www.houseoffusion.com/lists.cfm/link=i:15:1490
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/15
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:15
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.15
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to