So I managed to resolve this issue. Here is what I did:
Create the document:
<cfoutput query = "qGetUserEmail">
<cfdocument
name="Voucher"
format="PDF"
pagetype="custom"
pageheight="9"
pagewidth="8"
margintop="0"
marginbottom="0"
marginright="0"
marginleft="0"
unit="in"
fontembed="true"
backgroundvisible="true"
localurl="true">
</cfdocument>
Set the folder location for the PDF to be created
<cfset PDFFolder = #ExpandPath("../pdf")#>
Write the pdf to the server, creating a unique name from the user_id field in
the DB
<cffile action="write" file="#PDFFolder#/Voucher#user_id#.pdf"
output="#Voucher#" nameconflict="makeunique">
Attach the PDF to the email using the unique file
<cfmail from=xxxxx" to="#Email#" subject="Voucher Barcode" type="html"
mimeattach="#PDFFolder#/Voucher#user_id#.pdf">
Dear #Name#,<br>
Attached please find your voucher for #Deal_Name#<br><br>
</cfmail>
Crisis averted and we are going live now.
Bruce
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive:
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:354429
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm