sendOrderToClient mails also the administrator of the shop

Radd

No avatar

2005-10-24 14:24

Dear all,

I just added changes to sendOrderToClient plugin to enable administrator to receive the same e-mail as the customer.

here are the changes:
1. In file /plugin/sendOrdertoClient/actions_client.php row 23

orig:
$iOrder = throwOrdersIdTemp( $_SESSION['iCustomer'], null );
if( isset( $iOrder ) && is_numeric( $iOrder ) ){
$sTo = $_POST['sEmail'];
$sTitle = ltrim( $tpl->tbHtml( 'sendOrderToClient.tpl', 'EMAIL_TITLE' ) );
$sEmailContent = ltrim( $tpl->tbHtml( 'sendOrderToClient.tpl', 'EMAIL_HEAD' ) );
$sEmailContent .= trim( listBasket( $iOrder, 'sendOrderToClient.tpl' ) );

change to :
$iOrder = throwOrdersIdTemp( $_SESSION['iCustomer'], null );
if( isset( $iOrder ) && is_numeric( $iOrder ) ){
$sTo = $_POST['sEmail'];
$sBcc = $config['email'];
$sTitle = ltrim( $tpl->tbHtml( 'sendOrderToClient.tpl', 'EMAIL_TITLE' ) );
$sEmailContent = ltrim( $tpl->tbHtml( 'sendOrderToClient.tpl', 'EMAIL_HEAD' ) );
$sEmailContent .= trim( listBasket( $iOrder, 'sendOrderToClient.tpl' ) );

then at the end of the file after

@mail( $sTo, $sTitle, $sEmailContent, 'FROM: '.EMAIL );

add this:
/** To send the client's e-mail to shop owner */
@mail( $sBcc, $sTitle, $sEmailContent, 'FROM: '.EMAIL );

That's all!

So the admin(shop owner can get directly the information about the order

Great product

Radd

No avatar

2005-10-24 14:28

For my purposes I also added some more details in the template for sendOrderToClient.tpl:

here they are:
<!-- BEGIN EMAIL_TITLE -->
Your order # $iOrder has been received.
<!-- END EMAIL_TITLE -->
<!-- BEGIN EMAIL_HEAD -->

Order #: $iOrder
------------------------
Name and delivery location
------------------------
Name: $_POST[sFirstName] $_POST[sLastName]
Address: $_POST[sStreet]
Code: $_POST[sZipCode]
City: $_POST[sCity]
e-mail: $_POST[sEmail]
tel.: $_POST[sTelephone]

So I can see immediately the Id of the order, the e-mail and for direct contact the phone number.

Hope to help you as well!

Regards,

Great product

Back to top
about us | contact