Changing The "from" In The Email Notification Of New Order


In all previous versions, following help we got from cs-cart help desk, we altered the code with in app/function/fn-cart.php so that email notification will arrive to our orders department with the email of the customer in the "from" (rather than our own email).

This helped us with the integration with our customer service ticket system (the ticket was opened with the email of the customer, so it was easy to follow and reply.

This is how the code looked like (marked in bold red below).

// Notify order department
if ($notify_department == true) {
// Translate descriptions to admin language
fn_translate_products($order_info['products'], '', Registry::get('settings.Appearance.backend_default_language'), true);
$payment_method = array();
if ($payment_id) {
$payment_method = fn_get_payment_data($payment_id, $order_info['order_id'], Registry::get('settings.Appearance.backend_default_language'));

fn_add_user_data_descriptions($order_info, Registry::get('settings.Appearance.backend_default_language'));
'to' => 'default_company_orders_department',
'from' => $order_info['email'],
'reply_to' => $order_info['email'],
'data' => array(
'order_info' => $order_info,
'shipments' => $shipments,
'use_shipments' => $use_shipments,
'order_status' => fn_get_status_data(
'payment_method' => $payment_method,
'status_settings' => $status_settings,
'profile_fields' => fn_get_profile_fields('I', '', Registry::get('settings.Appearance.backend_default_language')),
'secondary_currency' => $secondary_currency
'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'],
), 'A', Registry::get('settings.Appearance.backend_default_language'));

in the latest version of CS CART the code is no longer within the fncart file.

I spent hours looking for its new location with no success.

can any one help with where the code for sending email notification about new order to the orders departments is located now?



Look at this file


Best regards


Thanks! It works :-)


You are welcome :)

Best regards


In the mentioned file try to replace

        UserTypes::ADMIN => [
            MailTransport::getId() => MailMessageSchema::create([
                'area'            => 'A',
                'from'            => 'default_company_orders_department',
        UserTypes::ADMIN => [
            MailTransport::getId() => MailMessageSchema::create([
                'area'            => 'A',
                'from'            => 'DataValue::create(''),

(!) Not tested