Mort-lemur Posted June 19, 2014 Share Posted June 19, 2014 I have been carrying out some changes to my 2.3.4 site to enable a PDF document to be attached to order confirmation emails, and when modifying the epdq callback.php file an error has crept in meaning that the callback fails. Im getting the following in my error log: PHP Fatal error: Call to undefined function tep_mail_attach() in /home/username/public_html/epdq_cpi/callback.php on line 270 The changes I made to the callback.php are as follows: $file = (DIR_WS_LANGUAGES . $language . '/' . EMAIL_PDF_ATTACHMENT_NAME); tep_mail_attach($order->customer['firstname'] . ' ' . $order->customer['lastname'], $order->customer['email_address'], EMAIL_TEXT_SUBJECT, $email_order, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS, $file, EMAIL_PDF_ATTACHMENT_NAME, 'application/pdf'); //tep_mail($order->customer['firstname'] . ' ' . $order->customer['lastname'], $order->customer['email_address'], EMAIL_TEXT_SUBJECT, $email_order, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS); // send emails to other people if (SEND_EXTRA_ORDER_EMAILS_TO != '') { tep_mail('', SEND_EXTRA_ORDER_EMAILS_TO, EMAIL_TEXT_SUBJECT, $email_order, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS); } // load the after_process function from the payment modules $payment_modules->after_process(); I have also included the following in my includes/functions/general.php // Send PDF Attachment BOF function tep_mail_attach($to_name, $to_email_address, $email_subject, $email_text, $from_email_name, $from_email_address, $file, $filename, $filetype) { if (SEND_EMAILS != 'true') return false; $message = new email(array('X-Mailer: osCommerce')); $text = strip_tags($email_text); if (email_USE_HTML == 'true') { $message->add_html($text); } else { $message->add_text($text); } $attachment = file_get_contents($file); $message->add_attachment($attachment, $filename, $filetype); $message->build_message(); $message->send($to_name, $to_email_address, $from_email_name, $from_email_address, $email_subject); } // Send PDF Attachment EOF and the callback.php calls to include application_top.php which in turn calls functions/general.php any idea where I have gone wrong? Many thanks Quote Now running on a fully modded, Mobile Friendly 2.3.4 Store with the Excellent MTS installed - See my profile for the mods installed ..... So much thanks for all the help given along the way by forum members. Link to comment Share on other sites More sharing options...
Mort-lemur Posted June 20, 2014 Author Share Posted June 20, 2014 OK all fixed and working again - looks like I had made an error in positionig the code change in my includes/functions/general.php which was causing the tep_mail_attach to not be defined correctly. Quote Now running on a fully modded, Mobile Friendly 2.3.4 Store with the Excellent MTS installed - See my profile for the mods installed ..... So much thanks for all the help given along the way by forum members. Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.