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

#   Custom Email based on User Group

##

- **[KeithBlow](/forum/user/33695-keithblow "View KeithBlow's Profile")**
- [![KeithBlow's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/33695-keithblow "View KeithBlow's Profile") Topic Author
- [ Offline](/forum/user/33695-keithblow)

Less More

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

11 years 11 months ago [\#182184](#182184) by [KeithBlow](/forum/user/33695-keithblow "View KeithBlow's Profile")  *[Custom Email based on User Group](/forum/27-checkout/873443-custom-email-based-on-user-group#182184 "-- HikaShop version -- : 2.3.4 -- Joomla version -- : 3.3.3 -- PHP version -- : 5.4.35 -- Browser(s) name and version -- : Chrome  Client needs the order, once submitted to go to a specific email address first that is not his own. However, it needs to be set based on a product category (or associated user group) so it doesn't effect the rest of the site.  For example : Client (Company A) has his own client (Company B) that can have employees log in and order products that are personalized just for them. However, once they order, the purchasing manager of Company B needs an email sent so they can approve it while Company A still receives the notification since their email address is set up in the HikaShop configuration.  Any chance this can be done?")* was created by *[KeithBlow](/forum/user/33695-keithblow "View KeithBlow's Profile")*

-- HikaShop version -- : 2.3.4
-- Joomla version -- : 3.3.3
-- PHP version -- : 5.4.35
-- Browser(s) name and version -- : Chrome

Client needs the order, once submitted to go to a specific email address first that is not his own. However, it needs to be set based on a product category (or associated user group) so it doesn't effect the rest of the site.

For example : Client (Company A) has his own client (Company ![B)](/media/kunena/emoticons/9.png "B)") that can have employees log in and order products that are personalized just for them. However, once they order, the purchasing manager of Company B needs an email sent so they can approve it while Company A still receives the notification since their email address is set up in the HikaShop configuration.

Any chance this can be done?

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI3LWNoZWNrb3V0Lzg3MzQ0My1jdXN0b20tZW1haWwtYmFzZWQtb24tdXNlci1ncm91cD90bXBsPW1hcmtkb3du) 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")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86541
- Thank you received: 14304
-
-

11 years 11 months ago [\#182189](#182189) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Custom Email based on User Group](/forum/27-checkout/873443-custom-email-based-on-user-group#182189 "-- HikaShop version -- : 2.3.4 -- Joomla version -- : 3.3.3 -- PHP version -- : 5.4.35 -- Browser(s) name and version -- : Chrome  Client needs the order, once submitted to go to a specific email address first that is not his own. However, it needs to be set based on a product category (or associated user group) so it doesn't effect the rest of the site.  For example : Client (Company A) has his own client (Company B) that can have employees log in and order products that are personalized just for them. However, once they order, the purchasing manager of Company B needs an email sent so they can approve it while Company A still receives the notification since their email address is set up in the HikaShop configuration.  Any chance this can be done?")*

Hi,

It can be done with a small custom code addition of the order creation/status notification emails via the menu System&gt;Emails: Code:

&lt;?php $userGroups = JAccess::getGroupsByUser($data-&gt;customer-&gt;user_cms_id); if(in_array(10,$userGroups)){ $data-&gt;customer-&gt;user_email .= ',manage@companya.com'; //for users in the user group with the id 10 }elseif(in_array(12,$userGroups)){ $data-&gt;customer-&gt;user_email .= ',manage@companyc.com'; //for users in the user group with the id 12 } ?&gt;

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

- **[KeithBlow](/forum/user/33695-keithblow "View KeithBlow's Profile")**
- [![KeithBlow's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/33695-keithblow "View KeithBlow's Profile") Topic Author
- [ Offline](/forum/user/33695-keithblow)

Less More

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

11 years 11 months ago [\#183052](#183052) by [KeithBlow](/forum/user/33695-keithblow "View KeithBlow's Profile")  Replied by *[KeithBlow](/forum/user/33695-keithblow "View KeithBlow's Profile")* on topic *[Custom Email based on User Group](/forum/27-checkout/873443-custom-email-based-on-user-group#183052 "-- HikaShop version -- : 2.3.4 -- Joomla version -- : 3.3.3 -- PHP version -- : 5.4.35 -- Browser(s) name and version -- : Chrome  Client needs the order, once submitted to go to a specific email address first that is not his own. However, it needs to be set based on a product category (or associated user group) so it doesn't effect the rest of the site.  For example : Client (Company A) has his own client (Company B) that can have employees log in and order products that are personalized just for them. However, once they order, the purchasing manager of Company B needs an email sent so they can approve it while Company A still receives the notification since their email address is set up in the HikaShop configuration.  Any chance this can be done?")*

Where do I put the code? I put it in the preload section, at the bottom and now when I hit Finish on an order, it brings up a blank page, though the order is created.

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

- **[Xavier](/forum/user/4105-xavier "View Xavier's Profile")**
- [![Xavier's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar4105.png)](/forum/user/4105-xavier "View Xavier's Profile")
- [ Offline](/forum/user/4105-xavier)

Less More

- Posts: 13201
- Thank you received: 2322
-
-
-
- [](http://www.kidiweb.fr)
-

11 years 11 months ago [\#183065](#183065) by [Xavier](/forum/user/4105-xavier "View Xavier's Profile")  Replied by *[Xavier](/forum/user/4105-xavier "View Xavier's Profile")* on topic *[Custom Email based on User Group](/forum/27-checkout/873443-custom-email-based-on-user-group#183065 "-- HikaShop version -- : 2.3.4 -- Joomla version -- : 3.3.3 -- PHP version -- : 5.4.35 -- Browser(s) name and version -- : Chrome  Client needs the order, once submitted to go to a specific email address first that is not his own. However, it needs to be set based on a product category (or associated user group) so it doesn't effect the rest of the site.  For example : Client (Company A) has his own client (Company B) that can have employees log in and order products that are personalized just for them. However, once they order, the purchasing manager of Company B needs an email sent so they can approve it while Company A still receives the notification since their email address is set up in the HikaShop configuration.  Any chance this can be done?")*

Hi,

Please set the error reporting level to "maximum" this will display the php error present in the blank page and give us more details on this error.

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

- **[KeithBlow](/forum/user/33695-keithblow "View KeithBlow's Profile")**
- [![KeithBlow's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/33695-keithblow "View KeithBlow's Profile") Topic Author
- [ Offline](/forum/user/33695-keithblow)

Less More

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

11 years 11 months ago [\#183238](#183238) by [KeithBlow](/forum/user/33695-keithblow "View KeithBlow's Profile")  Replied by *[KeithBlow](/forum/user/33695-keithblow "View KeithBlow's Profile")* on topic *[Custom Email based on User Group](/forum/27-checkout/873443-custom-email-based-on-user-group#183238 "-- HikaShop version -- : 2.3.4 -- Joomla version -- : 3.3.3 -- PHP version -- : 5.4.35 -- Browser(s) name and version -- : Chrome  Client needs the order, once submitted to go to a specific email address first that is not his own. However, it needs to be set based on a product category (or associated user group) so it doesn't effect the rest of the site.  For example : Client (Company A) has his own client (Company B) that can have employees log in and order products that are personalized just for them. However, once they order, the purchasing manager of Company B needs an email sent so they can approve it while Company A still receives the notification since their email address is set up in the HikaShop configuration.  Any chance this can be done?")*

Turning it on gave me a clue to what the error is and I fixed it, however, when I do submit the order (the email portion works) but I get this error on the page: Code:

Warning: explode() expects parameter 2 to be string, array given in path/libraries/joomla/string/punycode.php on line 209

And a box pops up and says:
[ ![&#91;img](http://webhelpus.opendrive.com/files/NF83OTM2MDYwM181WHVsbg/jetproblem.jpg) ](http://webhelpus.opendrive.com/files/NF83OTM2MDYwM181WHVsbg/jetproblem.jpg "&#91;img")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI3LWNoZWNrb3V0Lzg3MzQ0My1jdXN0b20tZW1haWwtYmFzZWQtb24tdXNlci1ncm91cD90bXBsPW1hcmtkb3du) 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")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86541
- Thank you received: 14304
-
-

11 years 10 months ago [\#183310](#183310) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Custom Email based on User Group](/forum/27-checkout/873443-custom-email-based-on-user-group#183310 "-- HikaShop version -- : 2.3.4 -- Joomla version -- : 3.3.3 -- PHP version -- : 5.4.35 -- Browser(s) name and version -- : Chrome  Client needs the order, once submitted to go to a specific email address first that is not his own. However, it needs to be set based on a product category (or associated user group) so it doesn't effect the rest of the site.  For example : Client (Company A) has his own client (Company B) that can have employees log in and order products that are personalized just for them. However, once they order, the purchasing manager of Company B needs an email sent so they can approve it while Company A still receives the notification since their email address is set up in the HikaShop configuration.  Any chance this can be done?")*

These are not errors from HikaShop.
For the first one, you can turn off the "error reporting" option of the Joomla configuration and that will remove it.
For the box popup up, I don't know where that comes from.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI3LWNoZWNrb3V0Lzg3MzQ0My1jdXN0b20tZW1haWwtYmFzZWQtb24tdXNlci1ncm91cD90bXBsPW1hcmtkb3du) 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.057 seconds

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