Jump to content

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

Change Mail-From And Reply-To For All Order-Mails Rate Topic   - - - - -

 
  • apr3455
  • Member
  • Members
  • Join Date: 12-Nov 14
  • 27 posts

Posted 12 November 2014 - 09:45 AM #1

Hello,

what we want to achieve is that all order notification mails that are being sent to the customer do have the same Mail-From and Reply-To mail adress. We want it to be the store admin mail address.

Currently the Mail-From and Reply-To address of the order notification mails is always the one of the vendor...

What files, hooks do we have to edit / create / use to accomplish our goal?

best regards,
Alex

 
  • tbirnseth
  • CS Cart Expert
  • Authorized Reseller
  • Join Date: 08-Nov 08
  • 12156 posts

Posted 13 November 2014 - 07:16 AM #2

Probably adjustments to the Mailer class to have it use the store credentials rather than the vendor credentials. But why don't you want the vendor to get the emails? Seems like you've be creating extra steps for yourself. Wouldn't it be better to use a php hook for 'send_mail_pre' to add a BCC to the email?

EZ Merchant Solutions: Custom (USA based) B2B Development, Consulting, Development and Special Projects (get a quote here).
Commercial addons, payment methods and modifications to meet your business and operations needs.


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

Posted 13 November 2014 - 09:32 AM #3

Hello,

what we want to achieve is that all order notification mails that are being sent to the customer do have the same Mail-From and Reply-To mail adress. We want it to be the store admin mail address.

Currently the Mail-From and Reply-To address of the order notification mails is always the one of the vendor...

What files, hooks do we have to edit / create / use to accomplish our goal?

best regards,
Alex


app/Tygh/Mailer.php

$mailer->SetFrom($from['email'], $from['name']);

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 1210     Multi-Vendor              USD 1250    Multi-Vendor PLUS           USD 3100 (2775)
CS-Cart Ultimate  USD 4025     CS-Cart + YOUPI      USD 1459      Multi-Vendor Ultimate       USD 7500 (6000)


 
  • apr3455
  • Member
  • Members
  • Join Date: 12-Nov 14
  • 27 posts

Posted 14 November 2014 - 08:15 AM #4

Hi eComLabs,

thanks but this would globaly change the "from" address for all mails being sent, wouldn't it?
We only want to change it for order mails.

Other mails like requests (addon) must not have the store admin mail address....

Any idea?

best regards,
Alex

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

Posted 14 November 2014 - 11:33 AM #5

Hi eComLabs,

thanks but this would globaly change the "from" address for all mails being sent, wouldn't it?
We only want to change it for order mails.

Other mails like requests (addon) must not have the store admin mail address....

Any idea?


Yes, you are right. To change the "from e-mail" for the orders only, please open the app/functions/fn.cart.php file, find the fn_order_notification function and this part of code:

if ($notify_user == true) {
		    Mailer::sendMail(array(
			    'to' => $order_info['email'],
			    'from' => 'company_orders_department',

you can replace the company_orders_department with the required e-mail. E.g.

if ($notify_user == true) {
		    Mailer::sendMail(array(
			    'to' => $order_info['email'],
			    'from' => 'abc@def.com',

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 1210     Multi-Vendor              USD 1250    Multi-Vendor PLUS           USD 3100 (2775)
CS-Cart Ultimate  USD 4025     CS-Cart + YOUPI      USD 1459      Multi-Vendor Ultimate       USD 7500 (6000)


 
  • apr3455
  • Member
  • Members
  • Join Date: 12-Nov 14
  • 27 posts

Posted 21 November 2014 - 01:46 PM #6

Thanks eComLabs!

I have come up with following solution:

Addon: my_changes:

function fn_my_changes_send_order_notification(&$order_info, $edp_data, $force_notification, $notified, $send_order_notification){
$order_info['company_id'] = 6;
}


6 is the ID of the Vendor who is also the owner of the shop... :)
So it always uses the mail address of vendor with ID: 6 for the order notification mails.

best regards,
Alex

 

Posted 14 December 2014 - 04:53 AM #7

Thanks eComLabs!

I have come up with following solution:

Addon: my_changes:

function fn_my_changes_send_order_notification(&$order_info, $edp_data, $force_notification, $notified, $send_order_notification){
$order_info['company_id'] = 6;
}


6 is the ID of the Vendor who is also the owner of the shop... :)
So it always uses the mail address of vendor with ID: 6 for the order notification mails.

best regards,
Alex


Hi,

I am new to CS-Cart and not very techy. I just read and do things for now. Could you guide me, step by step, How to do this?

 
  • majerfra
  • Advanced Member
  • Trial users
  • Join Date: 04-Oct 11
  • 134 posts

Posted 05 June 2015 - 07:12 AM #8

app/Tygh/Mailer.php

$mailer->SetFrom($from['email'], $from['name']);

Hi, where to insert this code in app/Tygh/Mailer.php? At end or anywhere else?
Thank you in advance

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

Posted 05 June 2015 - 10:35 AM #9

Hi, where to insert this code in app/Tygh/Mailer.php? At end or anywhere else?
Thank you in advance


I suggest you to use solution from post #5

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 1210     Multi-Vendor              USD 1250    Multi-Vendor PLUS           USD 3100 (2775)
CS-Cart Ultimate  USD 4025     CS-Cart + YOUPI      USD 1459      Multi-Vendor Ultimate       USD 7500 (6000)


 
  • majerfra
  • Advanced Member
  • Trial users
  • Join Date: 04-Oct 11
  • 134 posts

Posted 05 June 2015 - 11:18 AM #10

I suggest you to use solution from post #5

Ok, but I want the new user registration also send from same mail.as
which file to edit for new user notification, fn.users.php?

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

Posted 05 June 2015 - 12:52 PM #11

Ok, but I want the new user registration also send from same mail.as
which file to edit for new user notification, fn.users.php?


You are right, please find the following code in the fn_update_user function:

if (!empty($notify_user)) {
	    $from = 'company_users_department';

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 1210     Multi-Vendor              USD 1250    Multi-Vendor PLUS           USD 3100 (2775)
CS-Cart Ultimate  USD 4025     CS-Cart + YOUPI      USD 1459      Multi-Vendor Ultimate       USD 7500 (6000)