Main
Index
Search
Posts
Who's
Online
Log
In

Home: Products: CMS Builder: Plugins & Add-ons:
createPDF and attach to mail script

 

 


rjbathgate
User

Jul 27, 2011, 5:34 PM

Post #1 of 4 (827 views)
Shortcut
createPDF and attach to mail script Can't Post

Hello.

I have a send to mail script which currently handles uploaded files (uploaded via the form) (attaches to email sent).

I now want to be able to create a PDF of a record (using createPDF_display('attachment', $data, $fileName); or similar) and make it available to attach to an the email.

So, I think I need to use the createPDF function to create the PDF in a temp folder on the server, but NOT offer it to the user (i.e. no attachment or inline), and then return this temp file path, so I can update my mail script to do attach it.

So, I guess my question is, how do I use the createPDF function to save a pdf into a temp folder, but NOT return anything to the front end user, and to return to a variable the file path of said created pdf?

Cheers!
Rob


Toledoh
Enthusiast

Jul 27, 2011, 6:00 PM

Post #2 of 4 (825 views)
Shortcut
Re: [rjbathgate] createPDF and attach to mail script [In reply to] Can't Post

Have a look at http://www.interactivetools.com/iforum/Products_C2/CMS_Builder%3A_Plugins_%26_Add-ons_F40/gforum.cgi?post=86741 - hpefully it helps...
Cheers,

Tim Forrest
Toledoh Enterprises
www.toledoh.com.au


rjbathgate
User

Jul 27, 2011, 6:01 PM

Post #3 of 4 (824 views)
Shortcut
Re: [Toledoh] createPDF and attach to mail script [In reply to] Can't Post


In Reply To


Boom!!!

Thank you :)


rjbathgate
User

Jul 27, 2011, 6:42 PM

Post #4 of 4 (820 views)
Shortcut
Re: [rjbathgate] createPDF and attach to mail script [In reply to] Can't Post

EDIT

Got it working attaching both a pdf generated on the fly and an uploaded file via form.


Code
if (is_uploaded_file(@$coverletter)) { 
$fileb = fopen($coverletter,"rb");
$datab = fread($fileb,filesize($coverletter));
fclose($fileb);
}


sendMessage(array(
'from' => $EmailFrom,
'to' => $EmailTo,
'subject' => $Subject,
'text' => $Body,
'attachments' => array(
$cv_name => $data,
$coverletter_name => $datab
)
));


Thanks!


(This post was edited by rjbathgate on Jul 27, 2011, 6:48 PM)