violinman Posted November 21, 2019 Share Posted November 21, 2019 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 Link to comment Share on other sites More sharing options...
bsmither Posted November 21, 2019 Share Posted November 21, 2019 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. Link to comment Share on other sites More sharing options...
violinman Posted November 21, 2019 Author Share Posted November 21, 2019 Thanks bsmither, much appreciated, I will try it tomorrow. Brian Link to comment Share on other sites More sharing options...
violinman Posted November 22, 2019 Author Share Posted November 22, 2019 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 Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.