Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Barclays EPDQ Callback - I Generated an error.....


Mort-lemur

Recommended Posts

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

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

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.

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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...