question about modification to PDF Plugin

15 posts by 5 authors in: Forums > CMS Builder: Plugins & Add-ons
Last Post: March 7, 2011   (RSS)

Re: [Toledoh] question about modification to PDF Plugin

By Jason - March 7, 2011

Hi Tim,

A good place to start is to first get the form sending emails without the attachment. for example:

sendMessage(array(
'from' => @$_REQUEST['from'],
'to' => @$_REQUEST['to'],
'subject' => @$_REQUEST['subject'],
'text' => @$_REQUEST['message'],

)
));


Once you get this working, then try attaching the PDF. Here's a post that gives an example of sending a CSV file as an attachment:
http://www.interactivetools.com/forum/gforum.cgi?post=85097#85097

Hope this helps get you started.
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/

Re: [Jason] question about modification to PDF Plugin

By Toledoh - March 7, 2011

Hey Jason,

I'm so dang close, but yet so far. The code below works in that it takes the form data, sends the email and attaches the pdf - however, after clicking submit the browser trys to "Display" and the PDF that comes via email has errors (not properly decoded)...

(BTW: I changed "from, to, subject, message" to "a,b,c,d" because one of those fields is a reserved field or some such thing and was giving me errors)

// PDF VIA EMAIL
$pdf = '';
$url = "http://www.google.com/";
$data = createPDF_fromUrl($url);
createPDF_display('attachment', $data, 'example.pdf');


sendMessage(array(
'from' => @$_REQUEST['a'],
'to' => @$_REQUEST['b'],
'subject' => @$_REQUEST['c'],
'text' => @$_REQUEST['d'],
'attachments' => array(
'example.pdf' => $pdf
)
));

Cheers,

Tim (toledoh.com.au)

Re: [Toledoh] question about modification to PDF Plugin

By Dave - March 7, 2011

Hi Tim,

Try these changes:

// PDF VIA EMAIL
$pdf = '';
$url = "http://www.google.com/";
$data = createPDF_fromUrl($url);
//createPDF_display('attachment', $data, 'example.pdf');


sendMessage(array(
'from' => @$_REQUEST['a'],
'to' => @$_REQUEST['b'],
'subject' => @$_REQUEST['c'],
'text' => @$_REQUEST['d'],
'attachments' => array(
'example.pdf' => $data,
)
));


Let me know if that works for you.
Dave Edis - Senior Developer
interactivetools.com

By Toledoh - March 7, 2011

Woo Hoo!

You guys rock!
Cheers,

Tim (toledoh.com.au)