Secondary Order Admin Notification email based on usergroup

  • Posts: 12
  • Thank you received: 0
7 years 2 months ago #278737

-- HikaShop version -- : 3.2.0
-- Joomla version -- : 3.7.4
-- PHP version -- : 7.1
-- Browser(s) name and version -- : All

I am needing to have a secondary email (a different order notification) sent to the Admin based on the customers usergroup.

-> Customer Places Order
-> Admin receives standard "Order administrator notification "
-> If Usergroup 16, Admin receives secondary customized "Order administrator notification "

I've seen similar post like the one below, but they don't describe the fix for the issue described.

Also, they don't describe how to add an entirely new email to the list (there is no add button).

-Thanks


www.hikashop.com/support/forum/checkout/...d-on-user-group.html

I am using the business edition if that matters.

Last edit: 7 years 2 months ago by insightdesign.

Please Log in or Create an account to join the conversation.

  • Posts: 82868
  • Thank you received: 13378
  • MODERATOR
7 years 2 months ago #278755

Hi,

The post on the thread www.hikashop.com/support/forum/checkout/...er-group.html#182189 looks good. Did you try the modification ?
What happened ? Did you get any error ?

Please Log in or Create an account to join the conversation.

  • Posts: 12
  • Thank you received: 0
7 years 2 months ago #278804

nicolas wrote: Hi,

The post on the thread www.hikashop.com/support/forum/checkout/...er-group.html#182189 looks good. Did you try the modification ?
What happened ? Did you get any error ?


Hello,
Yes, I tried putting that code into the Admin Notification email, but now It is ONLY going to that specified address, and the admins are not getting the email as they were before. Do I need to replace the "user_email" with "admin_email"?

Also, concerning the second part of my question, how do I create a NEW email? There is a list of 15 emails, but no apparent way to add a new notification.
-Thanks
<?php
$userGroups = JAccess::getGroupsByUser($data->customer->user_cms_id);
if(in_array(10,$userGroups)){
 $data->customer->user_email .= ',manage@companya.com'; //for users in the user group with the id 10
}elseif(in_array(12,$userGroups)){
 $data->customer->user_email .= ',manage@companyc.com'; //for users in the user group with the id 12
}
?>

Please Log in or Create an account to join the conversation.

  • Posts: 12953
  • Thank you received: 1778
7 years 1 month ago #280728

Hello and sorry for the late reply,

Yes, I tried putting that code into the Admin Notification email, but now It is ONLY going to that specified address, and the admins are not getting the email as they were before. Do I need to replace the "user_email" with "admin_email"?

In that case, can you try it with that kind of code :
<?php
$userGroups = JAccess::getGroupsByUser($data->customer->user_cms_id);
if(in_array(10,$userGroups)){
 $mail->cc_email = 'manage@companya.com'; //for users in the user group with the id 10
}elseif(in_array(12,$userGroups)){
 $mail->cc_email = 'manage@companyc.com'; //for users in the user group with the id 12
}
?>

Also, concerning the second part of my question, how do I create a NEW email? There is a list of 15 emails, but no apparent way to add a new notification.


There is actually no option to create a new email for the moment, so the solution will directly be to create that email using code customization.

Best regards,
Mohamed Thelji.

Please Log in or Create an account to join the conversation.

Time to create page: 0.076 seconds
Powered by Kunena Forum