View Single Post
  #1  
Old 03-31-2012, 08:03 PM
 
minfinger minfinger is offline
 

X-Adept
  
Join Date: Apr 2009
Posts: 678
 

Default Multiple emails for order notification

Based on: http://forum.x-cart.com/showthread.php?t=34487

So I spent some time trying to figure this out and then it turned out to be much simpler than I was making it.

This is for Version 4.3.2

The following mod is for SMS text/emails. This can easily be modified to email the full notification to multiple addresses.
Instead of using:
Code:
$sms_email, "mail/order_notification_sms_subj.tpl", "mail/order_notification_sms.tpl",
use:
Code:
$sms_email, "mail/order_notification_subj.tpl", "mail/order_notification_admin.tpl",
And then make sure to change the $sms_email value to a proper email address.

STEP 1: For Processed Orders

Open include/func/func.order.php
Got to Line: 1294
PHP Code:
if ($config['Email_Note']['eml_order_p_notif_admin'] == 'Y') {
            
$to_customer $config['default_admin_language'];
            
func_send_mail($config["Company"]["orders_department"], "mail/order_notification_subj.tpl""mail/order_notification_admin.tpl"$config["Company"]["orders_department"], truetrue);
        } 

Replace code with:
PHP Code:
if ($config['Email_Note']['eml_order_p_notif_admin'] == 'Y') {
            
$to_customer $config['default_admin_language'];
            
$sms_email "10digitCellNumber@cingularme.com";       // NOTE - replace with your cellphone's SMS email address
//          func_send_mail($config["Company"]["orders_department"], "mail/order_notification_subj.tpl", "mail/order_notification_admin.tpl", $config["Company"]["orders_department"], true, true);    // NOTE - Uncomment this line if you would like to receive BOTH SMS and Email initial order notifications
            
func_send_mail($sms_email"mail/order_notification_sms_subj.tpl""mail/order_notification_sms.tpl"$config["Company"]["orders_department"], truetrue);    // NOTE - send processed order alert to cellphone via SMS
        


Version 2 (Optional)
STEP 1: For Initial Order notification to the Order Department

Open include/func/func.order.php
Goto Line 1493
PHP Code:
if ($config["Email_Note"]["enable_order_notif"]) {
        
$mail_smarty->assign("show_order_details""Y");
        
func_send_mail($config["Company"]["orders_department"], "mail/preauth_order_notification_subj.tpl""mail/preauth_order_notification.tpl"$userinfo["email"], truetrue);
        
$mail_smarty->assign("show_order_details""");
    } 

Replace with:
PHP Code:
if ($config["Email_Note"]["enable_order_notif"]) {
        
$mail_smarty->assign("show_order_details""Y");
        
$sms_email "10digitCellNumber@cingularme.com";       // NOTE - replace with your cellphone's SMS email address
        
func_send_mail($config["Company"]["orders_department"], "mail/preauth_order_notification_subj.tpl""mail/preauth_order_notification.tpl"$userinfo["email"], truetrue);
        
func_send_mail($sms_email"mail/order_notification_sms_subj.tpl",  "mail/order_notification_sms.tpl",  $config["Company"]["orders_department"], truetrue);    // NOTE - send  processed order alert to cellphone via SMS
        
$mail_smarty->assign("show_order_details""");
    } 

STEP 2 (SMS email subject line):

Create New File (in skin1/mail folder): order_notification_sms_subj.tpl

File Contents:
Code:
{* NOTE Custom MOD File - For SMS Cellphone Text Order Notification - You may hard-code anything into this Subject line that you see fit *} {config_load file="$skin_config"}{ $config.Company.company_name }: {$lng.lbl_order} #{$order.orderid}

STEP 3 (SMS email body line):

Create New File (in skin1/mail folder): order_notification_sms.tpl

File Contents:
Code:
{* NOTE Custom MOD File - SMS Notification to Admin via cellphone *} {config_load file="$skin_config"} {assign var=where value="A"} {if $customer ne ''}{assign var="_userinfo" value=$customer}{else}{assign var="_userinfo" value=$userinfo}{/if} {config_load file="$skin_config"} &nbsp;<BR> {$order.firstname} {$order.lastname}<BR> {$order.phone}<BR> {$order.s_statename}<BR> <BR> {foreach from=$products item=product} {$product.productcode} ({$product.amount})<br> {/foreach} <BR> {$lng.lbl_total}: {include file="currency.tpl" value=$order.total}

The above message body code shows the Order Number, Customer Name, Customer Phone, Customer State, Each Product SKU (Quantity), and Order Total Amount ($). Comment out those you do not wish displayed, or add other variables you would like to see. Just remember you only have about 150-160 characters per SMS alert message.

Please let me know if you find this useful. I haven't tested it in the newest version of X-Cart, but once you find the matching old code, then inserting the new SMS code should be a snap.

Tested on X-Cart 4.3.2

I tested this to one of my other email accounts that was different than my test account, before linking it to the SMS email of the phone I wanted to use.

Here's a list of SMS address per carrier:

HERE IS A LIST OF SOME POPULAR SMS EMAIL ADDRESS FORMATS:
Alltel: phonenumber@message.alltel.com
AT&T Wireless: (now Cingular): phonenumber@mmode.com
Boost Mobile: phonenumber@myboostmobile.com
Cingular: phonenumber@cingularme.com
Metro PCS: phonenumber@mymetropcs.com
Nextel: phonenumber@messaging.nextel.com
Ntelos: phonenumber@pcs.ntelos.net
Orange: phonenumber@orange.net
Sprint (now Sprint Nextel): phonenumber@messaging.sprintpcs.com
T-Mobile: phonenumber@tmomail.net
US Cellular: 10digit number@email.uscc.net
Verizon: phonenumber@vtext.com
Virgin Mobile: phonenumber@vmobl.com
__________________
X-Cart 4.3
Joomla
Among other things
Reply With Quote