Merging two queries for double-dynamic mail merge
Posted on 2006-07-18
Using CFDOCUMENT, I'm trying to creating a PDF thank-you letter to donors. Simply inserting the donor data into a message created within the CFDOCUMENT is no problem, but I'm trying to allow the client to modify the template dynamically as well. So basically we need to output the dynamic letter, and within the letter, output the dynamic donor data based on a URL.sort.
I've tried inserting #queryname.field# in the text of the dynamic letter (inside cfoutputs, of course), but the final PDF renders with the pound signs and not with the dynamic donor data.
Here is the CFDOCUMENT page I've been working with. Both queries work perfectly on their own. Any thoughts? Thanks!
<cfparam name="URL.sort" default="1">
<cfquery datasource="#dsn#" name="qGetDonor">
WHERE intTransID = #URL.sort#
<cfquery datasource="#dsn#" name="qGetLetter">
WHERE ID = 1