Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Add to \modules\invoices\save.php
- Add to the bottom, just above the smarty stuff.
- if($saved) {
- // On every invoice update, archive a copy.
- // Added by ELP on 3/22/2013
- $invoice = invoice::select($_POST['id']);
- //create PDF name
- $spc2us_pref = str_replace(" ", "_", $invoice['index_name']);
- $pdf_file_name = $spc2us_pref . '.pdf';
- //$pdf_file_name = "Invoice_" . $_POST['id'] ;
- // Create invoice
- $export = new export();
- $export -> format = "pdf";
- $export -> file_location = 'file';
- $export -> module = 'invoice';
- $export -> id = $_POST['id'];
- $export -> execute();
- $email = new email();
- $email -> format = 'invoice';
- //$email -> notes = "Textual message would go here, if necessary.";
- $email -> from_friendly = 'Invoice Record'; <-- CHOOSE A FROM NAME HERE!
- //$email -> bcc = "[email protected]";
- $email -> subject = $pdf_file_name;
- $email -> attachment = $pdf_file_name;
- $message = $email -> send ();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement