I created this code to notify users 1 week prior to expiration date...The query goes to the "Dates" TABLE and get the dates (field name: StartDate) and also goes to the "Program" TABLE to get the e-mail list (field name: EMail) of everybody whose dates are 1week prior to expiration date.
The problem I'm having w/ this code is that it gives me "Error resolving parameter PROGRAM.EMAIL" which is located in the "TO:" section of the <CFMAIL> tag. Will someone help me, please?
<cfset ExpirationDate = now() + 7>
<cfset ExpirationNum = DateFormat(#ExpirationDate#, "yyyymmdd">
<CFQUERY NAME="ExpirationNotice" DATASOURCE="#Application.DataSource#" DBTYPE="ODBC">
SELECT Dates.StartDate, Program.EMail
FROM Dates INNER JOIN Program ON Dates.ProgramID = Program.ProgramID
WHERE StartDate = #ExpirationNum# Order by StartDate
</CFQUERY>
<CFMAIL TO="#Program.EMail#"
FROM="jukebox@maingo.com"
SUBJECT="TEST"
QUERY="ExpirationNotice">
This message is a TEST and was sent by an
automatic mailer built with CFMAIL...Please,
Disregard this e-mail...
</CFMAIL>
The problem I'm having w/ this code is that it gives me "Error resolving parameter PROGRAM.EMAIL" which is located in the "TO:" section of the <CFMAIL> tag. Will someone help me, please?
<cfset ExpirationDate = now() + 7>
<cfset ExpirationNum = DateFormat(#ExpirationDate#, "yyyymmdd">
<CFQUERY NAME="ExpirationNotice" DATASOURCE="#Application.DataSource#" DBTYPE="ODBC">
SELECT Dates.StartDate, Program.EMail
FROM Dates INNER JOIN Program ON Dates.ProgramID = Program.ProgramID
WHERE StartDate = #ExpirationNum# Order by StartDate
</CFQUERY>
<CFMAIL TO="#Program.EMail#"
FROM="jukebox@maingo.com"
SUBJECT="TEST"
QUERY="ExpirationNotice">
This message is a TEST and was sent by an
automatic mailer built with CFMAIL...Please,
Disregard this e-mail...
</CFMAIL>