EasyCFM.COM ColdFusion Forums / Coding Help! / send to mailing list

   Reply to Discussion | New Discussion << previous || next >> 
Posted By Discussion Topic: send to mailing list

book mark this topic Printer-friendly Version  send this discussion to a friend  new posts last

Redmanz
11-10-2002 @ 8:29 AM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
Senior Member
Posts: 411
Joined: Oct 2002

Okay I have a working newsletter application I built, the application itself works fine sending out html newsletters. The next thing I would like to do is personalize the newsletters with something like

Dear #myQuery.firstname# #myQuery.lastname#

In my tests I have run so far I can send out the newsletter but only the first one is personalized and all the rest use that ones name? Any help appreciated

Question

Specialization is for Insects!

Webmaster
11-10-2002 @ 10:29 AM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
Administrator
Posts: 4542
Joined: Jan 2002

You need to insert the cfmail within a loop..

I.E.

<cfloop query="myQuery">
   <cfmail goes here>
      Dear #myQuery.firstname# #myQuery.lastname#

      Blah Blah Blah
   </cfmail>
</cfloop>


That should do it Smile

Thanks,
Pablo Varando
EasyCFM.COM, LLC.

Redmanz
11-10-2002 @ 3:35 PM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
Senior Member
Posts: 411
Joined: Oct 2002

Okay that worked great, thank you!

Now what I am trying to do is put a link on the bottom of each message with a remove me from list link. The link should have the users id included in it. I understand how to place id's into links etc. but for this application it does not seem to work. This is my revised code since the last post. The id is being pulled out of the loop with the user names etc.

To Delete Yourself from this Newsletter:
<a href="http://www.MyUrl.com/mail_delete.cfm?id=#sendmail.id#">Click Here</a>

Specialization is for Insects!

This message was edited by Redmanz on 11-10-02 @ 3:55 PM

webedge
11-17-2002 @ 1:42 PM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
Moderator
Posts: 238
Joined: Nov 2002

Try this!


<cfquery datasource="dsn" name="YourQuery">
  SELECT email
  FROM newsletter
</cfquery>
<cfmail to="#all.email#"
  from="you@yourdomain.com"
  subject="Whatever"
  query="all">


Dear #all.firstname# #all.lastname#

blah de blah

Regards,

You

********************************************************************************************
<a href="http://www.MyUrl.com/mail_delete.cfm?id=#all.id#">Click Here</a>
********************************************************************************************
</cfmail>



Works fine for my newsletter!

Phil

No matter how much you polish a turd, it's still a turd...

WebmasterEdge.com - Online resources for Webmasters


Website Designed and Developed by Pablo Varando.