I have a automated task that is running currently on cf 4.5 that I am having trouble moving to MX.
First thing I do is run a query to get all of the invoices from the previous day. In the cfmail tag I group them by the invoice number. With in the cfmail tag I generated dynamic information used in both sending the email, listing the line items and content. In MX for some reason is does not like the dynamic information in the cfmail tag. This works fine in 4.5 and it passes the code validator in the MX admin.
Error message: Element SENDCOPY is undefined in VAR.
Code:
<cfquery name="qGetOrder" datasource="cf_WT">
execute usp_getAllInvoices
</cfquery>
<cfset var.copyList = "webmaster@mydomain.com">
<cfmail to="#emailaddr#" from="#myFrom#" bcc="#var.sendCopy#" subject="#var.subject#" type="html" query="qGetOrder" group="invoiceNumber" server="mailserver">
<cfif left(PO, 4) eq "RMA##">
<cfset var.subject = "Return Receipt for Invoice ###invoiceNumber# -- returned on #dateformat(invoiceDate, "mm/dd/yyyy")#">
<cfelse>
<cfset var.subject = "Electronic Receipt for Invoice ###invoiceNumber# -- shipped on #dateformat(invoiceDate, "mm/dd/yyyy")#">
</cfif>
<cfif listfind(finalList, invoiceNumber)>
<cfset var.sendCopy = var.copyList>
<cfelse>
<cfset var.sendCopy = "">
</cfif>
<cfif len(loginname)><cfset myFrom = "#loginname#@mydomain.com"><cfelse><cfset myFrom = "invoice@mydomain.com"></cfif>
<cfoutput>
<cfif cat eq "Y">
<cfset var.banner = " <cfset var.bannerlink = " <cfelse>
<cfset var.banner = " <cfset var.bannerlink = " </cfif>
</cfoutput>
My mail content
</cfmail>
First thing I do is run a query to get all of the invoices from the previous day. In the cfmail tag I group them by the invoice number. With in the cfmail tag I generated dynamic information used in both sending the email, listing the line items and content. In MX for some reason is does not like the dynamic information in the cfmail tag. This works fine in 4.5 and it passes the code validator in the MX admin.
Error message: Element SENDCOPY is undefined in VAR.
Code:
<cfquery name="qGetOrder" datasource="cf_WT">
execute usp_getAllInvoices
</cfquery>
<cfset var.copyList = "webmaster@mydomain.com">
<cfmail to="#emailaddr#" from="#myFrom#" bcc="#var.sendCopy#" subject="#var.subject#" type="html" query="qGetOrder" group="invoiceNumber" server="mailserver">
<cfif left(PO, 4) eq "RMA##">
<cfset var.subject = "Return Receipt for Invoice ###invoiceNumber# -- returned on #dateformat(invoiceDate, "mm/dd/yyyy")#">
<cfelse>
<cfset var.subject = "Electronic Receipt for Invoice ###invoiceNumber# -- shipped on #dateformat(invoiceDate, "mm/dd/yyyy")#">
</cfif>
<cfif listfind(finalList, invoiceNumber)>
<cfset var.sendCopy = var.copyList>
<cfelse>
<cfset var.sendCopy = "">
</cfif>
<cfif len(loginname)><cfset myFrom = "#loginname#@mydomain.com"><cfelse><cfset myFrom = "invoice@mydomain.com"></cfif>
<cfoutput>
<cfif cat eq "Y">
<cfset var.banner = " <cfset var.bannerlink = " <cfelse>
<cfset var.banner = " <cfset var.bannerlink = " </cfif>
</cfoutput>
My mail content
</cfmail>