[Skip to main content](#vessel-content)

#   Rules for Admin Order Notifiation E-mails

##

- **[joelstad](/forum/user/1677-joelstad "View joelstad's Profile")**
- [![joelstad's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar1677.png)](/forum/user/1677-joelstad "View joelstad's Profile") Topic Author
- [ Offline](/forum/user/1677-joelstad)

Less More

- Posts: 38
- Thank you received: 0
-
-
-
-

15 years 6 months ago [\#15558](#15558) by [joelstad](/forum/user/1677-joelstad "View joelstad's Profile")  *[Rules for Admin Order Notifiation E-mails](/forum/4-how-to/15558-rules-for-admin-order-notifiation-e-mails#15558 "Hello Again!  Thanks to all the great support, I can now get the order summary on the admin notification e-mail and the details of the user submitting the order including the user's name, city and state.  What I'd like to do is customize the To: section of the e-mail so the notification goes to the representative for that area. For instance: We accept orders from anyone in any state. A customer places an order in California and I want a notification sent to the representative in California only. Right now I have an e-mail address on our mail server and that e-mail address automatically sends a copy of the message to reps in all 50 states.  Is there a way to do this?  Thanks in advance!")* was created by *[joelstad](/forum/user/1677-joelstad "View joelstad's Profile")*

Hello Again!

Thanks to all the great support, I can now get the order summary on the admin notification e-mail and the details of the user submitting the order including the user's name, city and state.

What I'd like to do is customize the To: section of the e-mail so the notification goes to the representative for that area. For instance: We accept orders from anyone in any state. A customer places an order in California and I want a notification sent to the representative in California only. Right now I have an e-mail address on our mail server and that e-mail address automatically sends a copy of the message to reps in all 50 states.

Is there a way to do this?

Thanks in advance!

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzE1NTU4LXJ1bGVzLWZvci1hZG1pbi1vcmRlci1ub3RpZmlhdGlvbi1lLW1haWxzP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86587
- Thank you received: 14325
-
-

15 years 6 months ago [\#15575](#15575) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: Rules for Admin Order Notifiation E-mails](/forum/4-how-to/15558-rules-for-admin-order-notifiation-e-mails#15575 "Hello Again!  Thanks to all the great support, I can now get the order summary on the admin notification e-mail and the details of the user submitting the order including the user's name, city and state.  What I'd like to do is customize the To: section of the e-mail so the notification goes to the representative for that area. For instance: We accept orders from anyone in any state. A customer places an order in California and I want a notification sent to the representative in California only. Right now I have an e-mail address on our mail server and that e-mail address automatically sends a copy of the message to reps in all 50 states.  Is there a way to do this?  Thanks in advance!")*

Hi,

There is no option for that in HikaShop. However, you can add some code in the emails in order to send to the appropriate email address.
You can edit the emails of HikaShop via the menu System-&gt;Emails (in the business edition).
There, you should be able to add at the end of the HTML version the code:

&lt;?php
$data-&gt;customer-&gt;user_email = 'name@email.com';

in order to send the email to a specific email.

But if you want to have different emails based on the state you can do like that:

&lt;?php
switch($data-&gt;cart-&gt;shipping_address-&gt;address_state){
case 'state_California_4265':
$data-&gt;customer-&gt;user_email = 'california@email.com';
break;
case 'state_Texas_4307':
$data-&gt;customer-&gt;user_email = 'texas@email.com';
break;
default:
$data-&gt;customer-&gt;user_email = 'default@email.com';
break;
}

the states namekey can be found in the database in the table hikashop_zone. I've only put here two of them so that you can run some tests.

Note that this code is not tested...

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzE1NTU4LXJ1bGVzLWZvci1hZG1pbi1vcmRlci1ub3RpZmlhdGlvbi1lLW1haWxzP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[joelstad](/forum/user/1677-joelstad "View joelstad's Profile")**
- [![joelstad's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar1677.png)](/forum/user/1677-joelstad "View joelstad's Profile") Topic Author
- [ Offline](/forum/user/1677-joelstad)

Less More

- Posts: 38
- Thank you received: 0
-
-
-
-

15 years 6 months ago [\#15576](#15576) by [joelstad](/forum/user/1677-joelstad "View joelstad's Profile")  Replied by *[joelstad](/forum/user/1677-joelstad "View joelstad's Profile")* on topic *[Re: Rules for Admin Order Notifiation E-mails](/forum/4-how-to/15558-rules-for-admin-order-notifiation-e-mails#15576 "Hello Again!  Thanks to all the great support, I can now get the order summary on the admin notification e-mail and the details of the user submitting the order including the user's name, city and state.  What I'd like to do is customize the To: section of the e-mail so the notification goes to the representative for that area. For instance: We accept orders from anyone in any state. A customer places an order in California and I want a notification sent to the representative in California only. Right now I have an e-mail address on our mail server and that e-mail address automatically sends a copy of the message to reps in all 50 states.  Is there a way to do this?  Thanks in advance!")*

Thank you! I'll mess with it and see what I come up with.

--Joel

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzE1NTU4LXJ1bGVzLWZvci1hZG1pbi1vcmRlci1ub3RpZmlhdGlvbi1lLW1haWxzP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[joelstad](/forum/user/1677-joelstad "View joelstad's Profile")**
- [![joelstad's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar1677.png)](/forum/user/1677-joelstad "View joelstad's Profile") Topic Author
- [ Offline](/forum/user/1677-joelstad)

Less More

- Posts: 38
- Thank you received: 0
-
-
-
-

15 years 6 months ago [\#15587](#15587) by [joelstad](/forum/user/1677-joelstad "View joelstad's Profile")  Replied by *[joelstad](/forum/user/1677-joelstad "View joelstad's Profile")* on topic *[Re: Rules for Admin Order Notifiation E-mails](/forum/4-how-to/15558-rules-for-admin-order-notifiation-e-mails#15587 "Hello Again!  Thanks to all the great support, I can now get the order summary on the admin notification e-mail and the details of the user submitting the order including the user's name, city and state.  What I'd like to do is customize the To: section of the e-mail so the notification goes to the representative for that area. For instance: We accept orders from anyone in any state. A customer places an order in California and I want a notification sent to the representative in California only. Right now I have an e-mail address on our mail server and that e-mail address automatically sends a copy of the message to reps in all 50 states.  Is there a way to do this?  Thanks in advance!")*

ok, I don't want to change who gets the user confirmation e-mail, I want to change who gets the admin notification based on the state.

Is that possible?

Thanks in advance!

--Joel

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzE1NTU4LXJ1bGVzLWZvci1hZG1pbi1vcmRlci1ub3RpZmlhdGlvbi1lLW1haWxzP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86587
- Thank you received: 14325
-
-

15 years 6 months ago [\#15597](#15597) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: Rules for Admin Order Notifiation E-mails](/forum/4-how-to/15558-rules-for-admin-order-notifiation-e-mails#15597 "Hello Again!  Thanks to all the great support, I can now get the order summary on the admin notification e-mail and the details of the user submitting the order including the user's name, city and state.  What I'd like to do is customize the To: section of the e-mail so the notification goes to the representative for that area. For instance: We accept orders from anyone in any state. A customer places an order in California and I want a notification sent to the representative in California only. Right now I have an e-mail address on our mail server and that e-mail address automatically sends a copy of the message to reps in all 50 states.  Is there a way to do this?  Thanks in advance!")*

That code and explanation was for the order admin notification.
In the order admin notification the $data-&gt;customer-&gt;user_email is the email of the administrator, not the one of the customer.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzE1NTU4LXJ1bGVzLWZvci1hZG1pbi1vcmRlci1ub3RpZmlhdGlvbi1lLW1haWxzP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[joelstad](/forum/user/1677-joelstad "View joelstad's Profile")**
- [![joelstad's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar1677.png)](/forum/user/1677-joelstad "View joelstad's Profile") Topic Author
- [ Offline](/forum/user/1677-joelstad)

Less More

- Posts: 38
- Thank you received: 0
-
-
-
-

15 years 6 months ago [\#15640](#15640) by [joelstad](/forum/user/1677-joelstad "View joelstad's Profile")  Replied by *[joelstad](/forum/user/1677-joelstad "View joelstad's Profile")* on topic *[Re: Rules for Admin Order Notifiation E-mails](/forum/4-how-to/15558-rules-for-admin-order-notifiation-e-mails#15640 "Hello Again!  Thanks to all the great support, I can now get the order summary on the admin notification e-mail and the details of the user submitting the order including the user's name, city and state.  What I'd like to do is customize the To: section of the e-mail so the notification goes to the representative for that area. For instance: We accept orders from anyone in any state. A customer places an order in California and I want a notification sent to the representative in California only. Right now I have an e-mail address on our mail server and that e-mail address automatically sends a copy of the message to reps in all 50 states.  Is there a way to do this?  Thanks in advance!")*

This is resolved, thanks!

I changed the check from shipping_address to billing_address as we don't actually ship any product and I changed the state to city and it worked perfectly.

The following code was added after the } and before the ?&gt; in the admin_order_notification file.

switch($data-&gt;cart-&gt;billing_address-&gt;address_city){
case 'City 1':
$data-&gt;customer-&gt;user_email = 'nobody-0@noplace.com';
break;
case 'City 2':
$data-&gt;customer-&gt;user_email = 'nobody-1@noplace.com';
break;
case 'City 3':
$data-&gt;customer-&gt;user_email = 'nobody-2@noplace.com';
break;
default:
$data-&gt;customer-&gt;user_email = 'nobody-3@noplace.com';
break;
}

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzE1NTU4LXJ1bGVzLWZvci1hZG1pbi1vcmRlci1ub3RpZmlhdGlvbi1lLW1haWxzP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[FRMYR](/forum/user/8596-frmyr "View FRMYR's Profile")**
- [![FRMYR's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/8596-frmyr "View FRMYR's Profile")
- [ Offline](/forum/user/8596-frmyr)

Less More

- Posts: 31
- Thank you received: 1
-
-

14 years 2 months ago [\#64273](#64273) by [FRMYR](/forum/user/8596-frmyr "View FRMYR's Profile")  Replied by *[FRMYR](/forum/user/8596-frmyr "View FRMYR's Profile")* on topic *[Re: Rules for Admin Order Notifiation E-mails](/forum/4-how-to/15558-rules-for-admin-order-notifiation-e-mails#64273 "Hello Again!  Thanks to all the great support, I can now get the order summary on the admin notification e-mail and the details of the user submitting the order including the user's name, city and state.  What I'd like to do is customize the To: section of the e-mail so the notification goes to the representative for that area. For instance: We accept orders from anyone in any state. A customer places an order in California and I want a notification sent to the representative in California only. Right now I have an e-mail address on our mail server and that e-mail address automatically sends a copy of the message to reps in all 50 states.  Is there a way to do this?  Thanks in advance!")*

Regarding this topic ([ www.hikashop.com/en/forum/4-how-to/15558...n-e-mails.html#15575](http://www.hikashop.com/en/forum/4-how-to/15558-rules-for-admin-order-notifiation-e-mails.html#15575)), I have a situation where I need to send to multiple email recipients BUT individually.

Normally one would list all emails in configuration as: salespro@abc.com, order@abc.com, otheremail@abc.com

There's a limitation in my Cloud Printer where I will have to print/email ONE at a time...no commas, no BCC, no CC and certainly no TOs of multiple designation.

Please let me what your thoughts and suggestions.

Thanks!

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzE1NTU4LXJ1bGVzLWZvci1hZG1pbi1vcmRlci1ub3RpZmlhdGlvbi1lLW1haWxzP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86587
- Thank you received: 14325
-
-

14 years 2 months ago [\#64412](#64412) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: Rules for Admin Order Notifiation E-mails](/forum/4-how-to/15558-rules-for-admin-order-notifiation-e-mails#64412 "Hello Again!  Thanks to all the great support, I can now get the order summary on the admin notification e-mail and the details of the user submitting the order including the user's name, city and state.  What I'd like to do is customize the To: section of the e-mail so the notification goes to the representative for that area. For instance: We accept orders from anyone in any state. A customer places an order in California and I want a notification sent to the representative in California only. Right now I have an e-mail address on our mail server and that e-mail address automatically sends a copy of the message to reps in all 50 states.  Is there a way to do this?  Thanks in advance!")*

It would require to send yourself the email.
Suppose that you can use the mail function of PHP, you could do something like that:
$content_of_the_email = ob_get_contents();
switch($data-&gt;cart-&gt;billing_address-&gt;address_city){
case 'City 1':
mail( 'nobody-0@noplace.com','Subject of the email',$content_of_the_email);
break;
case 'City 2':
mail( 'nobody-1@noplace.com','Subject of the email',$content_of_the_email);
break;
case 'City 3':
mail( 'nobody-2@noplace.com','Subject of the email',$content_of_the_email);
break;
default:
mail( 'nobody-3@noplace.com','Subject of the email',$content_of_the_email);
break;
}

If you can't use the mail function, you'll have to send them with joomla mail functions.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzE1NTU4LXJ1bGVzLWZvci1hZG1pbi1vcmRlci1ub3RpZmlhdGlvbi1lLW1haWxzP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop Install &amp; Update Product &amp; Category Display Content Creation Sales and Orders Orders management Reports &amp; Statistics Customers Checkout Payment Methods Shipping Methods Import &amp; Export (CSV, XLS…) Specific Features Affilation Taxes Wishlist Vote Carousel &amp; Slider Mass Actions Filters &amp; Search Discount &amp; Coupon Feature Request Integrations Showcase General Talk about HikaShop Development HikaShop 3.0 Beta Translation Commercial Jobs HikaShop Components HikaMarket Market: Feature requests Market: How to? Market: Bug Report HikaSerial General talk about HikaSerial Serial: Bug Report Serial: How to? Support en Français de HikaSerial (French Support) HikaSubscription HikaAuction Auction: Feature requests Auction: How to? Auction: Bug report Hikashop around the world Support en Français (French Support) Russian FAQ. Курс выживания с Hikashop. Частые вопросы и о Расширения Hikashop Наши сайты на Hikashop 日本語版サポート(Japanese Support) Thai German Archives Bug Report How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.079 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)
