Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

Send order notification to multiple email addresses

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 11-01-2012, 12:37 AM
  Warwick's Avatar 
Warwick Warwick is offline
 

X-Adept
  
Join Date: Mar 2003
Location: Somewhere on the web through European connection
Posts: 868
 

Question Send order notification to multiple email addresses

I must have overlooked this or misunderstood how to get this done.

Is it possible to let the shop send order notifications to multiple mail addresses (with X-Cart 4.2.x)?

At the moment only this (one address) is accepted, for example:
sales@myshop.com

I tried adding an extra address like this:
sales@myshop.com,anothermailaddress@theinternet.com
sales@myshop.com, anothermailaddress@theinternet.com

But this isn't accepted by the system i.e. resulting in an error message.
__________________
Installs: X-Cart 4.1.x - 4.4.x ∙∙ MySQL version: 5.0.45 ∙∙ Apache version: 2.2.8 (Unix) ∙∙ PHP version: 5.25
X-Cart add-ons: all ∙∙ Mods: A lot; too many ∙∙ Skin templates: Many
∙∙ Experience: Somewhere beyond newbie
-----------------------------------
------------------------------------------------------------------------------------------------------
Looking for the best dutch language pack? 4.1.x - 4.6.x compatibel, native speaker translation! More info
Reply With Quote
  #2  
Old 11-01-2012, 05:28 AM
  totaltec's Avatar 
totaltec totaltec is offline
 

X-Guru
  
Join Date: Jan 2007
Location: Louisville, KY USA
Posts: 5,823
 

Default Re: Send order notification to multiple email addresses

You can go in and modify the PHP to send to multiple addresses. It would probably be easier to just use your server and forward the email address to multiple parties. http://www.systemsabuse.com/2008/04/29/creating-a-single-forward-to-multiple-email-addresses-with-cpanel/
__________________
Mike White - Now Accepting new clients and projects! Work with the best, get a US based development team for just $125 an hour. Call 1-502-773-6454, email mike at babymonkeystudios.com, or skype b8bym0nkey

XcartGuru
X-cart Tutorials | X-cart 5 Tutorials

Check out the responsive template for X-cart.
Reply With Quote

The following user thanks totaltec for this useful post:
chamberinternet (01-13-2014)
  #3  
Old 11-01-2012, 05:39 AM
  Warwick's Avatar 
Warwick Warwick is offline
 

X-Adept
  
Join Date: Mar 2003
Location: Somewhere on the web through European connection
Posts: 868
 

Default Re: Send order notification to multiple email addresses

Thanks for the pointer, but unfortunately the cPanel solution is not available since this specific webshop is using its own (external) mail servers.
You have any idea what php file should be modified and how this can be done?
__________________
Installs: X-Cart 4.1.x - 4.4.x ∙∙ MySQL version: 5.0.45 ∙∙ Apache version: 2.2.8 (Unix) ∙∙ PHP version: 5.25
X-Cart add-ons: all ∙∙ Mods: A lot; too many ∙∙ Skin templates: Many
∙∙ Experience: Somewhere beyond newbie
-----------------------------------
------------------------------------------------------------------------------------------------------
Looking for the best dutch language pack? 4.1.x - 4.6.x compatibel, native speaker translation! More info
Reply With Quote
  #4  
Old 11-01-2012, 06:15 AM
  totaltec's Avatar 
totaltec totaltec is offline
 

X-Guru
  
Join Date: Jan 2007
Location: Louisville, KY USA
Posts: 5,823
 

Default Re: Send order notification to multiple email addresses

I would think that any mail server would allow forwarding. Well anyway, I believe that include/func/func.order.php would control sending the mail.

I see this around line 1438 in 4.4.X
Code:
if ($admin_notify) { // Notify orders department by email $mail_smarty->assign('show_order_details', 'Y'); func_send_mail( $config['Company']['orders_department'], 'mail/' . $prefix . 'order_notification_subj.tpl', 'mail/order_notification_admin.tpl', $userinfo['email'], true, true ); $mail_smarty->assign('show_order_details', '');
__________________
Mike White - Now Accepting new clients and projects! Work with the best, get a US based development team for just $125 an hour. Call 1-502-773-6454, email mike at babymonkeystudios.com, or skype b8bym0nkey

XcartGuru
X-cart Tutorials | X-cart 5 Tutorials

Check out the responsive template for X-cart.
Reply With Quote
  #5  
Old 11-01-2012, 11:43 AM
  Warwick's Avatar 
Warwick Warwick is offline
 

X-Adept
  
Join Date: Mar 2003
Location: Somewhere on the web through European connection
Posts: 868
 

Default Re: Send order notification to multiple email addresses

That mail server can forward of course but it should not, a bit difficult to explain why not.

I will take a look at the function php file, thanks again!
__________________
Installs: X-Cart 4.1.x - 4.4.x ∙∙ MySQL version: 5.0.45 ∙∙ Apache version: 2.2.8 (Unix) ∙∙ PHP version: 5.25
X-Cart add-ons: all ∙∙ Mods: A lot; too many ∙∙ Skin templates: Many
∙∙ Experience: Somewhere beyond newbie
-----------------------------------
------------------------------------------------------------------------------------------------------
Looking for the best dutch language pack? 4.1.x - 4.6.x compatibel, native speaker translation! More info
Reply With Quote
  #6  
Old 11-02-2012, 04:26 AM
  rogue's Avatar 
rogue rogue is offline
 

X-Adept
  
Join Date: Apr 2007
Location: Loveland, Ohio
Posts: 770
 

Default Re: Send order notification to multiple email addresses

I think that all you will need to change is the code that checks for a valid email address. This is the function func_email_validation_regexp which is in include/func/func.core.php. You need to add a comma to the allowed characters of the email address.
__________________
Richard Williams
Rogue Wave Limited

Initial Inventory Imports
Daily Inventory Updates
Daily Inventory Reports
Drop Ship Support
Order Export to Shipper/Supplier
Shopping Feeds That Work
Programming for X-Cart

richard@roguewavelimited.com
http://www.roguewavelimited.com
Reply With Quote

The following user thanks rogue for this useful post:
totaltec (11-02-2012)
  #7  
Old 11-02-2012, 07:21 AM
  totaltec's Avatar 
totaltec totaltec is offline
 

X-Guru
  
Join Date: Jan 2007
Location: Louisville, KY USA
Posts: 5,823
 

Default Re: Send order notification to multiple email addresses

Quote:
Originally Posted by rogue
You need to add a comma to the allowed characters of the email address.
Nice and easy solution, I like it. Might want to verify though that this is only in the admin, seems like a problem if the comma was accepted throughout the site on all email fields.
__________________
Mike White - Now Accepting new clients and projects! Work with the best, get a US based development team for just $125 an hour. Call 1-502-773-6454, email mike at babymonkeystudios.com, or skype b8bym0nkey

XcartGuru
X-cart Tutorials | X-cart 5 Tutorials

Check out the responsive template for X-cart.
Reply With Quote
  #8  
Old 12-01-2012, 03:55 AM
 
PhilJ PhilJ is offline
 

X-Guru
  
Join Date: Nov 2002
Posts: 4,094
 

Default Re: Send order notification to multiple email addresses

This SQL patch does the trick... (v4.4.x - v4.5.x)
Code:
REPLACE INTO xcart_config VALUES ('orders_department','Orders department email address','first@email.com,second@email.com','Company',330,'text','','','email');

The others available are...
Code:
REPLACE INTO xcart_config VALUES ('site_administrator','Site administrator email address','first@email.com,second@email.com','Company',310,'text','','','email'); REPLACE INTO xcart_config VALUES ('users_department','Users department email address','first@email.com,second@email.com','Company',320,'text','','','email'); REPLACE INTO xcart_config VALUES ('support_department','Help/Support department email address','first@email.com,second@email.com','Company',340,'text','','','email');

The caveat is that where emails are displayed elsewhere in your store, it will show both, so you may need to adjust / hard code the order invoice etc.
__________________
xcartmods.co.uk
Reply With Quote
  #9  
Old 09-23-2014, 11:11 AM
  DanielleHoyt's Avatar 
DanielleHoyt DanielleHoyt is offline
 

Newbie
  
Join Date: Dec 2013
Location: California, US
Posts: 9
 

Default Re: Send order notification to multiple email addresses

Hi PhilJ
I've tried your patch on 4.6.4 and it keeps giving me error.
I have tried every variation; adding a space between the commas, switching up the email addresses, changing "REPLACE" to "INSERT".
I even tried editing the "xcart_data.sql" file in SQL Server rather than uploading the patch through x-cart.

Please help, do you have any more information on this?
__________________
X-Cart 4.6.0
Reply With Quote
  #10  
Old 09-23-2014, 11:14 AM
  totaltec's Avatar 
totaltec totaltec is offline
 

X-Guru
  
Join Date: Jan 2007
Location: Louisville, KY USA
Posts: 5,823
 

Default Re: Send order notification to multiple email addresses

Danielle, it would be helpful if you could explain what the error message said.
__________________
Mike White - Now Accepting new clients and projects! Work with the best, get a US based development team for just $125 an hour. Call 1-502-773-6454, email mike at babymonkeystudios.com, or skype b8bym0nkey

XcartGuru
X-cart Tutorials | X-cart 5 Tutorials

Check out the responsive template for X-cart.
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 08:46 AM.

   

 
X-Cart forums © 2001-2020