Every time an order is created by an admin, I want to get a copy of the notification.
I want to pass my email address to the fn_order_notification in the file fn.cart.php
I have the my_changes addon working.
So in my init.php file I register my hook:
fn_register_hooks( 'order_notification' );
function fn_my_changes_order_notification($order_info, $order_statuses, $force_notification){ $mailer->addrAppend('Bcc', array('name@myserver.com')); }
Of course this is not working. So in the function fn_order_notification, I want to BCC to myself only on the email that is sent to customer :
// Notify customer if ($notify_user == true) {$mailer->send(array( 'to' => $order_info['email'], 'from' => 'company_orders_department', 'data' => array( 'order_info' => $order_info, 'shipments' => $shipments, 'tracking_numbers' => $tracking_numbers, 'shipping_methods' => $shipping_methods, 'order_status' => $order_status, 'payment_method' => $payment_method, 'profile_fields' => $profile_fields, 'profields' => $profields, 'secondary_currency' => $secondary_currency, 'take_surcharge_from_vendor' => $take_surcharge_from_vendor ), 'template_code' => $email_template_name, 'tpl' => 'orders/order_notification.tpl', // this parameter is obsolete and is used for back compatibility 'company_id' => $order_info['company_id'], ), 'C', $order_info['lang_code']); if (!empty($edp_data)) { $mailer->send(array( 'to' => $order_info['email'], 'from' => 'company_orders_department', 'data' => array( 'order_files_list_url' => fn_url("orders.order_downloads&order_id={$order_info['order_id']}", 'C'), 'order_info' => $order_info, 'edp_data' => $edp_data, ), 'template_code' => 'edp_access', 'tpl' => 'orders/edp_access.tpl', // this parameter is obsolete and is used for back compatibility 'company_id' => $order_info['company_id'], ), 'C', $order_info['lang_code']); } }
What am I doing wrong in my hook setup?