Sender Name In Notification Email

Hi,



I have a query regarding multi vendor cs-cart v4.2.4. Whenever emails go to customer after he places the order he sees sender name to be the vendor who added the product. Here is what i would like to do.



I wish to create an id sales@mydomain.com with name as My Domain Sales. Whenever any email goes out to customer (Order Related). he should see the Sender Name as My Domain Sales. I am able to edit the order template files to change the subject and body of email but i have no clue how to change the sender name. Any help would be really appreciated.



Please see the image attached.



–Best

email.jpg

Good day,



Open the app/functions/fn.cart.php file and find the fn_order_notification function and replace:



// Notify customer
if ($notify_user == true) {
Mailer::sendMail(array(
'to' => $order_info['email'],
'from' => 'company_orders_department',
'data' => array(
'order_info' => $order_info,
'shipments' => $shipments,
'use_shipments' => $use_shipments,
'order_status' => $order_status,
'payment_method' => $payment_method,
'status_settings' => $status_settings,
'profile_fields' => $profile_fields,
'secondary_currency' => $secondary_currency,
'take_surcharge_from_vendor' => $take_surcharge_from_vendor
),
'tpl' => 'orders/order_notification.tpl',
'company_id' => $order_info['company_id'],
), 'C', $order_info['lang_code']);
if (!empty($edp_data)) {
Mailer::sendMail(array(
'to' => $order_info['email'],
'from' => 'company_orders_department',
'data' => array(
'order_info' => $order_info,
'edp_data' => $edp_data,
),
'tpl' => 'orders/edp_access.tpl',
'company_id' => $order_info['company_id'],
), 'C', $order_info['lang_code']);
}
}




with



// Notify customer
if ($notify_user == true) {
Mailer::sendMail(array(
'to' => $order_info['email'],
'from' => 'sales@mydomain.com',
'data' => array(
'order_info' => $order_info,
'shipments' => $shipments,
'use_shipments' => $use_shipments,
'order_status' => $order_status,
'payment_method' => $payment_method,
'status_settings' => $status_settings,
'profile_fields' => $profile_fields,
'secondary_currency' => $secondary_currency,
'take_surcharge_from_vendor' => $take_surcharge_from_vendor
),
'tpl' => 'orders/order_notification.tpl',
'company_id' => $order_info['company_id'],
), 'C', $order_info['lang_code']);
if (!empty($edp_data)) {
Mailer::sendMail(array(
'to' => $order_info['email'],
'from' => 'sales@mydomain.com',
'data' => array(
'order_info' => $order_info,
'edp_data' => $edp_data,
),
'tpl' => 'orders/edp_access.tpl',
'company_id' => $order_info['company_id'],
), 'C', $order_info['lang_code']);
}
}




where sales@mydomain.com is the required e-mail address

Hello,



The company name and the address are taken from the Setting-> Company.



Why haven't you changed the company name in the setings?

Settings ->Company->Company.



Also you may enter [color=#282828][font=arial, verdana, tahoma, sans-serif]sales@mydomain.com in the Settings->Company-> Order department e-mail address. [/font][/color]



Best regards, Alt-team.

[quote name='Alt-team' timestamp='1418648376' post='199800']

Hello,



The company name and the address are taken from the Setting-> Company.



Why haven't you changed the company name in the setings?

Settings ->Company->Company.



Also you may enter [color=#282828][font=arial, verdana, tahoma, sans-serif]sales@mydomain.com in the Settings->Company-> Order department e-mail address. [/font][/color]



Best regards, Alt-team.

[/quote]



I think, because it is replaced by the vendor e-mail in MVE

[quote name='eComLabs' timestamp='1418657258' post='199819']

I think, because it is replaced by the vendor e-mail in MVE

[/quote]



Oh, sorry. Yes.



Using the code from eComLabs only email address were used.

And as we understood you also need to change the name.



Instead of eComLabs code you should use



// Notify customer
if ($notify_user == true) {
Mailer::sendMail(array(
'to' => $order_info['email'],
'from' => 'company_orders_department',
'data' => array(
'order_info' => $order_info,
'shipments' => $shipments,
'use_shipments' => $use_shipments,
'order_status' => $order_status,
'payment_method' => $payment_method,
'status_settings' => $status_settings,
'profile_fields' => $profile_fields,
'secondary_currency' => $secondary_currency,
'take_surcharge_from_vendor' => $take_surcharge_from_vendor
),
'tpl' => 'orders/order_notification.tpl',

), 'C', $order_info['lang_code']);
if (!empty($edp_data)) {
Mailer::sendMail(array(
'to' => $order_info['email'],
'from' => 'company_orders_department',
'data' => array(
'order_info' => $order_info,
'edp_data' => $edp_data,
),
'tpl' => 'orders/edp_access.tpl',

), 'C', $order_info['lang_code']);
}
}




[color=#282828][font=arial, verdana, tahoma, sans-serif]In this case the name and the address will be taken from the settings of the MVE owner'company.[/font][/color]



[color=#282828][font=arial, verdana, tahoma, sans-serif]Best regards, Alt-team.[/font][/color]

If you want to use e-mail defined in the settings, just replace:



'from' => 'company_orders_department',




with



'from' => 'default_company_orders_department',




in mentioned part of code. Thanks.

We have thought about this variant at first, but we were not sure that it will work correctly. Have no time to check it.



But our variant is also correct.



If you have any other questions, please contact us. We are happy to answer!



Best regards, Alt-team.

Hi guys,



I have the same issue and I am not able to fix it:



On the fn.cart.php file I have changed this line:



'from' => 'company_orders_department',



with



'from' => 'myemail@domain.com',



but the email is no longer send. It seems nothing works except “company_orders_department”. Do you know where is “company_orders_department” defined?



I would like to change just the name which appears into the 'From' field on the email the users receive after they make an order. The sender email can remain as it is.



Please advise.

Thanks!

I managed to fix it by adding the bolded code into the app/functions/fn.cart.php file:



// Notify customer

if ($notify_user == true) {



$_from = array(

'email' => 'muemail@domain.com',

'name' => 'New_Name'

);




Mailer::sendMail(array(

'to' => $order_info['email'],

'from' => $_from,

'data' => array(…

Thank you for sharing this information

Is there any way to customer get email from mydomain.com and also a link of vendor or vendor details who is selling it . Please guide

[quote name='samivohra' timestamp='1427279186' post='208994']

Is there any way to customer get email from mydomain.com and also a link of vendor or vendor details who is selling it . Please guide

[/quote]



I am afraid, no without additional code modifications

we are also at your service

I managed to fix it by adding the [b]bolded[/b] code into the app/functions/fn.cart.php file:

// Notify customer
if ($notify_user == true) {

[b]$_from = array(
'email' => 'muemail@domain.com',
'name' => 'New_Name'
);[/b]

Mailer::sendMail(array(
'to' => $order_info['email'],
'from' => [b]$_from[/b],
'data' => array(...
..............................

Hello,

I have the same problem regarding the vendor's name appearing on customers email notification (Multivendor 4.11). I don't understand where should I add that piece of code into the app/functions/fn.cart.php file. Could you please give more precision ?

Thanks in advance for responding.

LC

Or you can just use our EZ Hide Vendor Fields addon that can also modifiy email addresses in email headers and email company content. The docs are located here.

For the latest versions open the following file

app/schemas/notifications/events.php

and replace

        UserTypes::CUSTOMER => [
            MailTransport::getId() => MailMessageSchema::create([
                'area'            => SiteArea::STOREFRONT,
                'from'            => 'company_orders_department',
                'to'              => DataValue::create('order_info.email'),
                'template_code'   => DataValue::create('template_code'),
                'legacy_template' => 'orders/order_notification.tpl',
                'company_id'      => DataValue::create('order_info.company_id'),
                'storefront_id'   => DataValue::create('order_info.storefront_id'),
                'language_code'   => DataValue::create('order_info.lang_code', CART_LANGUAGE)
            ]),
        ],

with

        UserTypes::CUSTOMER => [
            MailTransport::getId() => MailMessageSchema::create([
                'area'            => SiteArea::STOREFRONT,
                'from'            => 'default_company_orders_department',
                'to'              => DataValue::create('order_info.email'),
                'template_code'   => DataValue::create('template_code'),
                'legacy_template' => 'orders/order_notification.tpl',
                'company_id'      => DataValue::create('order_info.company_id'),
                'storefront_id'   => DataValue::create('order_info.storefront_id'),
                'language_code'   => DataValue::create('order_info.lang_code', CART_LANGUAGE)
            ]),
        ],

Then clear cache

(!) Not tested

For the latest versions open the following file

app/schemas/notifications/events.php

and replace

        UserTypes::CUSTOMER => [
            MailTransport::getId() => MailMessageSchema::create([
                'area'            => SiteArea::STOREFRONT,
                'from'            => 'company_orders_department',
                'to'              => DataValue::create('order_info.email'),
                'template_code'   => DataValue::create('template_code'),
                'legacy_template' => 'orders/order_notification.tpl',
                'company_id'      => DataValue::create('order_info.company_id'),
                'storefront_id'   => DataValue::create('order_info.storefront_id'),
                'language_code'   => DataValue::create('order_info.lang_code', CART_LANGUAGE)
            ]),
        ],

with

        UserTypes::CUSTOMER => [
            MailTransport::getId() => MailMessageSchema::create([
                'area'            => SiteArea::STOREFRONT,
                'from'            => 'default_company_orders_department',
                'to'              => DataValue::create('order_info.email'),
                'template_code'   => DataValue::create('template_code'),
                'legacy_template' => 'orders/order_notification.tpl',
                'company_id'      => DataValue::create('order_info.company_id'),
                'storefront_id'   => DataValue::create('order_info.storefront_id'),
                'language_code'   => DataValue::create('order_info.lang_code', CART_LANGUAGE)
            ]),
        ],

Then clear cache

(!) Not tested

Hi eComLabs,

Thanks for your response, it actually worked.

Once again big thanks.

Regards,

LC

You are welcome! :)

You are welcome! :)

Hi,

I just noticed that the problem was exactly the same for return notifications (RMA). Sender's name is the vendor and not the company name. Any idea of what modifications should I make?

Kind regards,

LC

Hi,

I just noticed that the problem was exactly the same for return notifications (RMA). Sender's name is the vendor and not the company name. Any idea of what modifications should I make?

Kind regards,

LC

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

Try to replace

'from'            => 'company_orders_department',

with

'from'            => 'default_company_orders_department',

Then clear cache

(!) Not tested