Jump to content
violinman

Print Order Form Payment Gateway

Recommended Posts

Hello, I have been using this form for clients to pay by bank transfer for several years and it works fine but I want have the gateway.class.php to email my address as well as the client.

This is the block of code from line 238:

// Format data
                        $order_summary['order_date'] = formatTime($order_summary['order_date'],false,true);
                        
                        $order_summary['link']         = $GLOBALS['storeURL'].'/index.php?_a=vieworder&cart_order_id='.$order_summary['cart_order_id'];
                        $GLOBALS['smarty']->assign('DATA', $order_summary);
                        $GLOBALS['smarty']->assign('BILLING', $billing);
                        $GLOBALS['smarty']->assign('SHIPPING', $shipping);
                        $GLOBALS['smarty']->assign('TAXES', $vars['taxes']);
                        $GLOBALS['smarty']->assign('PRODUCTS', $vars['products']);
                        Mailer::getInstance()->sendEmail($order_summary['email'], $content);

 

How can I get the last line Mailer::getinstance() to email to a second address as well as the client 'email' I have tried adding the other email address in the form of a string like this

Mailer::getInstance()->sendEmail($order_summary['email', '[email protected]'], $content);

but it just crashes the page.

Many thanks,

Brian

 

Share this post


Link to post
Share on other sites

Please try it this way:

Mailer::getInstance()->sendEmail($order_summary['email'].',[email protected]', $content);

There is now a comma separating the two emails as a single string of text. The Mailer function checks for this comma and splits the parts into an array. Then, each element of the array gets added into the Mailer's list of addresses to send to.

You can also use:

Mailer::getInstance()->sendEmail($order_summary['email'].','.$this->_config['email_address'], $content);

which appends the comma and then the store's default email address.

Share this post


Link to post
Share on other sites

Hello, I used the second line you suggested which works fine. Thank you for your help.

I have another related question, if I mark a sale in orders "Order Complete" admin then sends another copy of the order email to both myself and to the client, how can I stop this second email from being sent?

Many thanks,

Brian

Share this post


Link to post
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
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...