Hi,
We want if the order is completed to send an order notification with a bcc. The code below works, but we want only send the email with bcc if we notify the user and if notify the user is unchecked there must be no notification sent to the user. This should be easy. When we tested the code below the user received 2 emails. Is there a way around it?
When we tested the code below the user received 2 emails. Is there a way around it?
if ($order_info['status'] == 'C') {/** @var \Tygh\Mailer\Mailer $mailer */ $mailer = Tygh::$app['mailer']; $mailer->send(array( 'to' => $order_info['email'], 'from' => 'company_orders_department', 'bcc' => 'default_company_bcc', 'data' => array( 'notify_user' => true, '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, 'company_id' => $order_info['company_id'], ), 'C', $order_info['lang_code']); }