Customize user registration email sent to administrator

  • Posts: 31
  • Thank you received: 0
5 years 10 months ago #302436

-- HikaShop version -- : 4.0.1
-- Joomla version -- : 3.9.1
-- PHP version -- : 7.2.13
-- Browser(s) name and version -- : Firefox latest

Hi! I've already read the following topic:
www.hikashop.com/forum/customers/875872-...istration-email.html
www.hikashop.com/forum/2-general-talk-ab...essential.html#52829

I want to put all possible information in the email sent to administrator after a new user registered but any of the above topic works for me. Maybe they are too old.

I do the following:
In Hikashop -> Menu System -> Submenu Emails
I choose User account administrator notification email.
I put a print_r($data) to see all possible data available but the registration fields are not there. Here is how it looks like :
stdClass Object (
[user_id] => 2
[user_cms_id] => 558
[user_email] => This email address is being protected from spambots. You need JavaScript enabled to view it.
[user_partner_email] =>
[user_params] => stdClass Object (
[user_custom_fee] => 0
[partner_fee_currency] => 5
[user_partner_lead_fee] => 0
[user_partner_percent_fee] => 0
[user_partner_flat_fee] => 0
[user_partner_click_fee] => 0 )
[user_partner_id] => 0
[user_partner_price] => 0.00000
[user_partner_paid] => 0
[user_created_ip] =>
[user_unpaid_amount] => 0.00000
[user_partner_currency_id] => 0
[user_created] => 1537796821
[user_currency_id] => 0
[user_partner_activated] => 1
[website] =>
[create_billing_account] =>
[id] => 558
[name] => Helene Larocque
[username] => This email address is being protected from spambots. You need JavaScript enabled to view it.
=> helenelarocque@hotmail.com [password] => ************* [block] => 0 [sendEmail] => 0 [registerDate] => 2018-05-22 17:29:42 [lastvisitDate] => 2018-12-06 22:44:32 [activation] => $2y$10$zKg.VKlr./HX1X6D0z50g.ch2veZQyYw9z3xb7Z.ERb53MWL61bGa [params] => {"admin_style":"","admin_language":"","language":"","editor":"","helpsite":"","timezone":""} [lastResetTime] => 2018-11-13 15:17:23 [resetCount] => 1 [otpKey] => [otep] => [requireReset] => 0 [partner_url] => https://www.bboxsolutions.com/administrator/index.php?option=com_hikashop&ctrl=email&task=preview&tmpl=component&mail_name=user_account_admin_notification [activation_url] => https://www.bboxsolutions.com/administrator/index.php?option=com_hikashop&ctrl=email&task=preview&tmpl=component&mail_name=user_account_admin_notification [active] => 1 [user_data] => stdClass Object *RECURSION* ) There is no address, province, postal code and so one. What can I do to add the registration form value to the admin email? Thank you![email] => This email address is being protected from spambots. You need JavaScript enabled to view it.
[password] => *************
[block] => 0
[sendEmail] => 0
[registerDate] => 2018-05-22 17:29:42
[lastvisitDate] => 2018-12-06 22:44:32
[activation] => $2y$10$zKg.VKlr./HX1X6D0z50g.ch2veZQyYw9z3xb7Z.ERb53MWL61bGa
[params] => {"admin_style":"","admin_language":"","language":"","editor":"","helpsite":"","timezone":""}
[lastResetTime] => 2018-11-13 15:17:23
[resetCount] => 1
[otpKey] =>
[otep] =>
[requireReset] => 0
[partner_url] => www.bboxsolutions.com/administrator/inde...t_admin_notification
[activation_url] => www.bboxsolutions.com/administrator/inde...t_admin_notification
[active] => 1
[user_data] => stdClass Object *RECURSION* )

There is no address, province, postal code and so one. What can I do to add the registration form value to the admin email?
Thank you!

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
5 years 10 months ago #302453

Hi,

The address data is not given to the email.
If you want it, you'll have to do something like that:

$addressClass = hikashop_get('class.address');
$addresses = $addressClass->getByUser($data->user_id);
var_dump($addresses);

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

  • Posts: 31
  • Thank you received: 0
5 years 10 months ago #302476

Great! It's working perfectly. Do I really have to open a topic for this kind of thing or is it documented elsewhere (I may have missed it)?

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
5 years 10 months ago #302479

Hi,

You have to open a topic. Code customization is a developer thing.
Our documentation (and normally the support too) is for the merchants setting up or using their shop.
Normally, a developer should be able to get the data available in any view override with a var_dump($this); and for that, run the necessary MySQL queries to load the data he needs based on the data already available and then display it the way he wants.
Or even better, dive in the files of HikaShop to get a pitcture of the structure and how it works so that he can then use the functions available like in the code I gave you (but this takes some time so it's more for big projects than just some view customization).
Now we can give pointers and some pieces of code in some cases, but if it's too involved, we usually ask our users to have a developer work on that for them.

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

Time to create page: 0.063 seconds
Powered by Kunena Forum