Thanks for your help yesterday - found an alternative solution now, partly
using your code - thanks for the ideas
Will
----- Original Message -----
From: <[EMAIL PROTECTED]>
Newsgroups: cf-talk
Sent: Tuesday, September 11, 2001 6:14 PM
Subject: Re: Complicated mail/DB problem
> why couldn't you just read SELECT all the emails that have not been sent
> for that user , elegantly concatenate the bodies, and just let it rip?
>
>
>
>
> "W Luke" <[EMAIL PROTECTED]> on 09/11/2001 11:58:59 AM
>
> Please respond to [EMAIL PROTECTED]
>
> To: CF-Talk <[EMAIL PROTECTED]>
> cc:
>
> Subject: Complicated mail/DB problem
>
>
> Hi.
>
> Before I ask my question, I'd like to offer my sincerest condolences to
> America, to the lost and anyone else affected by today's unbelievable
> events. I was fortunate, or unfortunate enough to watch it live on TV -
> how
> lucky I/we are that we can be so detached from such devastation. God's
> speed to all.
>
>
>
>
> I have a complicated mail and DB question. On one of my sites, there are
a
> fair amount of "Email Notification" things going on with CFMail. For
> instance, a user might asked to be notified of 3 or 4 things and will
> receive 4 seperate emails as and when an even occurs. What I want to do
is
> instead of triggering cfmail each time, and sending hundreds of emails,
> insert the data into the Database and run CFSchedule periodically to send
> the emails.
>
> So let's say cfschedule runs a script every 30 minutes. The script finds
> 50
> records, 30 of which are distinct email addresses - cfmail sends them all
> out, and a "MailSent" Yes/No field is set to Yes. The other 20
> records/emails are destined for 5 people - 4 emails each. What I need to
> do
> is loop through them, checking the "mailtype" field, collating *one* email
> for each 5 people.
>
> Let's say [EMAIL PROTECTED] has 4 emails in the Database that are about to be
> sent. One contains information on the number of hits his banner has had
> today; the 2nd informs him of updated info in the news section. The 3rd
> details an Advert he has that is expiring in a days time, and the 4th
shows
> site-stats. Each of these emails or records in the DB will have a unique
> "MailType" field. What I'd then need to do is "create" one email to send
> to
> [EMAIL PROTECTED] but which contains all 4 records.
>
> Can anyone advise how I'd go about this? Currently my Table in the DB
> (called MailSpool) is as follows:
>
> mailID
> mailTo
> mailFrom
> mailSubject
> mailBody
> mailSent (YesNo)
> mailDate (Time/date field)
> mailType
>
> Any advice or tips would be appreciated.
>
> Will
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Your ad could be here. Monies from ads go to support these lists and provide more
resources for the community. http://www.fusionauthority.com/ads.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists