Jump to content

  • You cannot start a new topic
  • You cannot reply to this topic

Changing The "from" In The Email Notification Of New Order Rate Topic   - - - - -

 
  • wakeup
  • Newbie
  • Members
  • Join Date: 19-Nov 16
  • 6 posts

Posted 24 November 2019 - 07:15 PM #1

Hi,

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'));
$mailer->send(array(
'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(
$order_info['status'],
STATUSES_ORDER,
$order_info['order_id'],
Registry::get('settings.Appearance.backend_default_language'),
$order_info['company_id']
),
'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?

 

Thanks

 

 



 
  • soft-solid
  • Junior Member
  • Authorized Reseller
  • Join Date: 19-Apr 10
  • 997 posts

Posted 24 November 2019 - 10:12 PM #2

Hello

 

Look at this file

/app/schemas/notifications/events.php

 

Best regards

Robert


Team of SoftSolid
cs-cart.pl

 
  • wakeup
  • Newbie
  • Members
  • Join Date: 19-Nov 16
  • 6 posts

Posted 24 November 2019 - 11:02 PM #3

Thanks! It works :-) 



 
  • soft-solid
  • Junior Member
  • Authorized Reseller
  • Join Date: 19-Apr 10
  • 997 posts

Posted 24 November 2019 - 11:06 PM #4

Hello

 

You are welcome :)

 

Best regards

Robert


Team of SoftSolid
cs-cart.pl

 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 19982 posts

Posted 25 November 2019 - 06:52 AM #5

In the mentioned file try to replace

 

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

(!) Not tested


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    Multi-Vendor PLUS           USD 3100 (2775)
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      Multi-Vendor Ultimate       USD 7500 (6000)