Skip to main content
Inspiring
October 4, 2006
Question

QofQ?

  • October 4, 2006
  • 19 replies
  • 1201 views
I imported a csv and created a query object . yay. The query object is
called 'SendList' using:
<cfhttp url=" http://mywebsite/Mailer/campaign/csv/#campaign.csv#"
name="sendlist" method="get" textqualifier="">

Now I need to 'compare' that query object to another Recordset / database
table to produce a final list (emailList). hmmm.

I planned on using:
<cfquery name="emailList" datasource="**">
SELECT E.email, E.name
FROM SendList E LEFT JOIN optout O
ON E.email = O.email
WHERE O.email Is Null
<cfquery>

to produce a final list, but can't figure out how to 'compare' the 2 items
to produce that list. Would I use query of queries using my 'SendList'?

Any help would be appreciated.


This topic has been closed for replies.

19 replies

Inspiring
October 7, 2006
> I apologize for 'squawking' to the forum for help. Please, in the future,
> ignore posts with my name on them.

Don't get all silly. Like I said, I'm happy to help, just provided you try
to help yourself first.

Do you really think anything I said in my preceeding post is either
inaccurate or inappropriate advice?

--
Adam
Inspiring
October 6, 2006
Actually I did the cfmail and the looping correctly. That was not the issue.
I normally do self posting forms, without an action page, with calls to CFCs
for functionality. The issue was that I tried coding it on the same page
while still doing a self posting form. Since part of the code was inserting
the converted csv doc to a temp database, by submitting the form to a self
post, it was reinserting it to make doubles.

I apologize for 'squawking' to the forum for help. Please, in the future,
ignore posts with my name on them.


Inspiring
October 6, 2006
Wally, I think you might be best served at least TRYING to help yourself
before you come squawking to us. Have you read the documentation for how
<cfmail> works? Maybe you should.

http://livedocs.macromedia.com/coldfusion/7/htmldocs/00001592.htm

If you follow that lot through, you should be able to work out where you're
going wrong.

I don't mind helping you out, but you should be doing at least a minimum
level of self-help before you start asking other people to do your work for
you (which is what a lot of your postings here pretty-much equate to).

If - having RTFMed - you still can see it, sing out.

--
Adam
Inspiring
October 5, 2006
Well that didn't seem to work too well. Each person on the list got 2 emails
and the message was supposed to be 'hello' but was:

'hello' on the first email and
'hellohellohellohellohello' on the second second..

There was a total of 4 people on the list...

Help!

cfif IsDefined ('Send_Mail')>
<cfmail from="#campaign.emailfrom#" to="#mailist.email#"
replyto="#campaign.emailreply#" server="***" subject="#campaign.subject#"
query="mailist">
<cfmailpart type="html">
<cfoutput>#campaign.html#</cfoutput>
</cfmailpart>
<cfmailpart type="text">
<cfoutput>#campaign.plaintext#</cfoutput>
</cfmailpart>
</cfmail>
<cflocation url="done.cfm" addtoken="no">
</cfif>


Inspiring
October 5, 2006
You can pass <cfmail> a query. Why don't you use that instead of the loop?

--
Adam
Inspiring
October 5, 2006
I am having a problem with looping over a query.
I have a query that contains all the people who have not opted out of a
list. I want to send them an email. I am using the query to specifiy the
loop, but I keep getting all the emails sent to the top address. I need it
to step and repeat through each person. What am I doing wrong?

<cfloop query="mailist">
<cfmail from="#campaign.emailfrom#" to="#mailist.email#"
replyto="#campaign.emailreply#" server="***" subject="#campaign.subject#">
<cfmailpart type="html">
<cfoutput>#campaign.html#</cfoutput>
</cfmailpart>
<cfmailpart type="text">
<cfoutput>#campaign.plaintext#</cfoutput>
</cfmailpart>
</cfmail>
</cfloop>


Inspiring
October 5, 2006
> Nevermind, I figured it out.

Good stuff!

--
Adam
Inspiring
October 5, 2006
Nevermind, I figured it out.


Inspiring
October 5, 2006
> Ummm...That last bit threw me off..

Which bit? And what about it did you not understand?

--
Adam
Inspiring
October 5, 2006
If your optout table contains records of people who should not receive mail, how could you possibly have null values in the email field?

If you have any control over the db design, you should consider changing the optout table with a field in the table that stores e-mail addresses.