Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

bbosc2

Archived
  • Posts

    1
  • Joined

  • Last visited

Profile Information

bbosc2's Achievements

  1. Possible Fix to Extra Order Emails problem. I have the same problem as others with extra order emails not being sent after installing this contribution. Currently running CRE Loaded 6.15 on my local network - Debian/ Apache / Dovecot ( pop3 server). I'm very new to the scene and my PHP is rudimentary at best. The following may nevertheless shed some light on where the problem lies. 1. Edit /catalog/includes/modules/email_invoice/email_invoice.php as shown:- // Mod to fix Fancy emails and extra order emails tep_mail_fancy_invoice($order->customer['firstname'] . ' ' . $order->customer['lastname'], $order->customer['email_address'], EMAIL_TEXT_SUBJECT, $ei_message, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS); // send emails to other people if (SEND_EXTRA_ORDER_EMAILS_TO != '') { tep_mail_fancy_invoice('', SEND_EXTRA_ORDER_EMAILS_TO, EMAIL_TEXT_SUBJECT, $ei_message, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS); } Substitute the above in place of this code:_ // $ei_message->build_message(); // $ei_message->send($order->customer['name'], $order->customer['email_address'], STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS, EMAIL_TEXT_SUBJECT); // if (SEND_EXTRA_ORDER_EMAILS_TO != '') { // $ei_message->send(STORE_OWNER, SEND_EXTRA_ORDER_EMAILS_TO, $order->customer['name'], $order->customer['email_address'], EMAIL_TEXT_SUBJECT); // } 2. Add this to /includes/functions/general.php //// //! Send email (text/html) using MIME // This is the central mail function. The SMTP Server should be configured // correct in php.ini // Parameters: // $to_name The name of the recipient, e.g. "Jan Wildeboer" // $to_email_address The eMail address of the recipient, // e.g. [email protected] // $email_subject The subject of the eMail // $ei_message The content of the eMail, may contain HTML entities // $from_email_name The name of the sender, e.g. Shop Administration // $from_email_adress The eMail address of the sender, // e.g. [email protected] function tep_mail_fancy_invoice($to_name, $to_email_address, $email_subject, $ei_message, $from_email_name, $from_email_address) { if (SEND_EMAILS != 'true') return false; // Instantiate a new mail object // $message = new email(array('X-Mailer: osCommerce Mailer')); // Build the text version // $text = strip_tags($email_text); // if (EMAIL_USE_HTML == 'true') { // $message->add_html($email_text, $text); // } else { // $message->add_text($text); // } // Send message $ei_message->build_message(); $ei_message->send($to_name, $to_email_address, $from_email_name, $from_email_address, $email_subject); } I have shown the "commented out" sections of the original code so you can see what's going on. Nothing fancy, simply arranges for the functions "build_message" and "send" to NOT be called directly from email_invoice.php. I left the original "tep_mail" function in place to avoid any possible disturbance to other system functions. Compare the above to the original code and you will get the drift. The above seems to work on my system. I can now again arrange for multiple emails from Admin. I used the format [email protected], [email protected] I am not sure if this will work on a live site though. Again, this is only intended to serve as a possible pointer to where the actual problem lies. I would be very grateful if people with PHP coding skills could take a look at this further. It's a great contribution. Thanks
×
×
  • Create New...