Bcc Order Department E-Mail Address For All Supplier Notifications?

Looking for a way to have all the supplier notifications Bcc'd to Order department e-mail address.
Looking through forums indicates that it should be possible but no easy fix for a newbie on CS-Cart.
​As many others have mentioned over the years, very surprised this is not implemented out of the box. In notifications area there really should be a way to select more than 1 receiver.

Im not sure on multi vendor, but in standard cs cart you jast add more emails to the fields seperated by comma

Im not sure on multi vendor, but in standard cs cart you jast add more emails to the fields seperated by comma

in suppliers add-on, when trying to add a second email address in the Contact Section with both a comma or semicolon you get a red error message

The email address in the E-mail field is invalid.

Running latest version of CS-Cart Ultimate 4.14.1.SP1

(That does work in the
Company Settings for emails but there is still no way I can see to have the Supplier Notifications also sent to another emails address (ideally the company Orders dept.)

I almost sure that it is required to extend the following schema to add bcc

app/addons/suppliers/schemas/notifications/events.post.php

I almost sure that it is required to extend the following schema to add bcc

app/addons/suppliers/schemas/notifications/events.post.php

so in here?

$supplier_event = [
    'id'        => 'suppliers.order.supplier_notified',
    'group'     => 'orders',
    'name'      => [
        'template' => 'suppliers.event.order.supplier_notified.name',
        'params'   => [
            '[status]' => '',
        ],
    ],
    'data_provider' => [SuppliersDataProvider::class, 'factory'],
    'receivers' => [
        'S' => [
            MailTransport::getId() => MailMessageSchema::create([
                'area'            => 'A',
                'from'            => 'company_orders_department',
                'to'              => DataValue::create('supplier.data.email'),
                'reply_to'        => 'company_orders_department',
                'template_code'   => 'suppliers_notification',
                'legacy_template' => 'addons/suppliers/notification.tpl',
                'language_code'   => DataValue::create('lang_code', CART_LANGUAGE),
            ]),
        ],
    ],
];
would it work by just adding this below the 'to'?
'bcc'        => 'company_orders_department',

no that does not work as an easy edit, must be more to it :-(

In the code I see that the "bcc" parameter is supported

On what line did you place it? Have you cleared cache after these changes?

I added it in like this

                'to'              => DataValue::create('supplier.data.email'),
                'bcc' => 'company_orders_department',
                'reply_to'        => 'company_orders_department',

cleared cache via admin and even deleting whole cache directory

did not work...

After detailed examination, we found that the bcc is supported by mail sender, but not supported by the code which processes notification events schemas. Additional code changes are required here

this thread "seems to point the way but as a CS-Cart newbie it is a bit beyond my scope here.

https://forum.cs-cart.com/topic/49588-send-bcc-email-when-order-is-complete-and-notify-user/

Any further pointers or ideas?

Here's a hook function you can use/modify to suit your needs:

function fn_[ADDON]_mailer_send_pre(&$mObj, &$transport, &$message, $area, $lang_code) {
  $params = $message->getData();
  $order_info = empty($params['order_info']) ? array() : $params['order_info'];
  $toAR = $message->getTo();
  $to = implode(',', array_keys($toAR));

// If no $to OR no email in order_info OR ‘email’ does not contain $to
// This should only BCC on order emails sent to customer
if( empty($to)
|| empty($order_info[‘email’])
|| (strpos($order_info[‘email’], $to) === false)
)
return;

// Set your conditions here. I.e. has a parent_order_id, etc.
if( $bcc = function_to_get_your_bcc_addresses() ) { // Get the bcc address to use
$_bcc = explode(‘,’, $bcc); // Split if mulitple
foreach($_bcc as $addr) {
if( !$addr )
continue;
$message->addBCC(trim($addr));
}
$params[‘Bcc’] = $bcc;
}