Looking at the FAQ I see the nice little piece of code below. But I am not sure what to do with it. What file would I add that too? My .module? Or some where else?

Thanks.

<?php
  module_load_include('inc', 'print_pdf', 'print_pdf.pages');  // require print_pdf.pages.inc

  // set up email
  $recipients[] = email@example.com;
  $subject = "Your PDF is attached";
  $body = '<p>Your PDF is attached</p>';
  $path = $node->nid;
  $attachments[] = array(   // attach ticket
    'filecontent' => print_pdf_generate_path($path),  // call the print_pdf function to generate PDF content string
    'filemime' => 'application/pdf',
    'filename' => $filename,
  );

  // send email
  mimemail( $settings['from'], $recipients, $subject, $body, FALSE, array(), drupal_html_to_text(decode_entities($body)), $attachments );
?>

Comments

jcnventura’s picture

Status: Active » Fixed

Yes, to your code/module.. However, if you're even asking, I'd recommend that you contact someone with more experience in developing with Drupal.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.