This content has been marked as final. Show 3 replies
Generally, the term "stored procedure" is used to mean a piece of SQL code that is stored and run in the database server. It sounds like what you mean is a ColdFusion Scheduled Task - a piece of CF code that is run automatically. You can set these up using either the CF administrator or the <cfschedule> tag. Breaking up your mailings is a good idea since CF will probably time out if you try to execute 250,000 mailings at once. You could do something like this:
1) If unsent records, do:
2) Select X number of unsent records
3) Send mail
4) Update X records as having been sent
You would just have to make sure that you time it correctly, otherwise you could wind up with 1 process starting before the other finishes and some people will get duplicate emails.
The email content is provided using a form in the sites CMS - at the moment I have the submit button going to a page that runs the cycle, sends the email to 2,000 users, marks it as sent in the database and then waits 5 minutes before reloading that page and starting from the next record.
How do I implement that with cfshedule? I've never needed to use it before so I'm totally in the dark.