cfschedule cfmail containing hit results with start date set to date column in db
Posted on 2007-07-30
I have a tricky cfschedule/ cfmail task- My site is almost done and I need to try to keep it completely automated since I have a real job. I already have welcome mail that is sent with results of their db insert at enrollment time and it works great. Now I need to email a news letter (eventually will be a billing statement when site is worth charging for) complete with individual hit results to my members on a monthly basis. I have a column in dbo.members called "member_since" which contains the date/ time of insert (enrollment). Here is what I have but I know the syntax is wrong before I even run it. Please keep in mind, I need this to happen on every 30 day anniversary for every member. I'll need to change the static part of the message body from time to time but I got the cfmail part down pretty well. Thanks in advance, Andy- electriciansnet.com
<cfquery name="schedMembers" datasource="#enet#" maxrows="1">
SELECT CompanyName, member_Since FROM dbo.members
<cfschedule action = "update"
task = "Status Report For #CompanyName#"
operation = "HTTPRequest"
url = "mailer/mailer_status.cfm"
startDate = "#schedMembers.member_Since#+#CreateTimeSpan(30,0,0,0)#"<!---GOT TO BE WRONG--->
startTime = "12:25 PM"
interval = "monthly"
resolveURL = "Yes"
publish = "No"
requestTimeOut = "600">