Hikashop address fields in Joomla admin mail

  • Posts: 410
  • Thank you received: 9
  • Hikaserial Subscription Hikashop Business
2 years 4 months ago #343040

-- HikaShop version -- : 4.6.0
-- Joomla version -- : 4.1.5
-- PHP version -- : 7.4.xxx

Hello,

how can we get the Hikashop Address fields into the Joomla Admin mail?
we now get this mail from Joomla:
com_users.registration.admin.verification_request
Hallo beheerder,

Een nieuwe gebruiker heeft zich geregistreerd op {SITENAME}.
De gebruiker heeft het e-mailadres bevestigd en verzoekt het account goed te keuren.
Deze e-mail bevat de gegevens:
Naam : {NAME}
E-mailadres: {EMAIL}
Gebruikersnaam: {USERNAME}

Het account kan geactiveerd worden door op onderstaande link te klikken:
{ACTIVATE}

How can we get the fields from Hikashop in this mail?
{address_company}
{address_title} {address_firstname} {address_lastname}
{address_street}

regards,
Michiel

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

  • Posts: 82867
  • Thank you received: 13374
  • MODERATOR
2 years 4 months ago #343041

Hi,

To do that, you need to develop a plugin of the group "system" implementing the event onMailBeforeRendering($id,&$templateObj)
You need to check that $id is equal to com_users.registration.admin.verification_request.
Then, you can initialize HikaShop by requiring HikaShop's main helper file.
Then, you can load the data of the address of the current user:

$user_id = hikashop_loadUser();
$addressClass = hikashop_get('class.address');
$addresses = $addressClass->getByUser($user_id);
$oneAddress = reset($addresses);

And then you can use
$templateObj->addTemplateData(array('key1'=>'value1','key2'=>'value2'));
And then in your email template, you can use {key1} and {key2} and they will be replaced by value1 and value2.

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

  • Posts: 410
  • Thank you received: 9
  • Hikaserial Subscription Hikashop Business
2 years 3 months ago #343768

Hello Nicolas,
I have been looking at what you said.
But i also saw that there is an mail with HIKA_USER_ACCOUNT_ADMIN_NOTIFICATION_SUBJECT and in this mail the adminitrator gets an email that a new user has registered with name and username and url in it..
Is there a way that we can trigger in this e-mail the address and phonenumber and also the link for the administrator to activate this user.
So instead of using the joomla core emails??

Thanks.

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

  • Posts: 82867
  • Thank you received: 13374
  • MODERATOR
2 years 3 months ago #343781

Hi,

If you're using the HikaShop registration form, then it will automatically use HikaShop admin email.
So instead of using Joomla's registration form, use HikaShop's and you should be fine.

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

  • Posts: 410
  • Thank you received: 9
  • Hikaserial Subscription Hikashop Business
2 years 3 months ago #343798

Hello Nicolas,

When we use only the registration form of hikashop, will it show all entered data also to the admin to check before he approves the registered user? Like we have now with joomla? e.g. Now when someone register, he gets a verifaction email, with link he has to click on. After that the admin gets an email of the registered person with link to activate this users account.
Will the same work flow still excists?

Regards,
Mark

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

  • Posts: 82867
  • Thank you received: 13374
  • MODERATOR
2 years 3 months ago #343800

Hi,

The same workflow exists with HikaShop's registration form, yes.
The "user account" and "user account admin" emails of HikaShop used for this won't display the extra information entered by the user by default. However, via the menu System>Emails, these emails can be customized relatively easily to add that extra information. At least, no plugin is required to modify them like for Joomla's emails.

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

  • Posts: 410
  • Thank you received: 9
  • Hikaserial Subscription Hikashop Business
2 years 3 months ago #344018

Hello,

The registration process that we have now is:
1. customer fills in registration form
2. customer receives email from hikashop to verify registration
3. admin receives mail from Joomla with username and email from customer with link to activate account. *
4. customer/user receives email notification that his/her account is activated

* At point 3 we want the address fields (and custom field) from hikashop to show in the mail.

If we use the hikashop admin mail, the admin recieves immediately the admin notification email before customer/user verify's its registration. This is not correct.

Please give us advise how to make this registration process properly.

Regards,
Mark

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

  • Posts: 82867
  • Thank you received: 13374
  • MODERATOR
2 years 3 months ago #344081

Hi,

I'm sorry but I took the time to reproduce and I don't see the same process.

What I see is this:
1. customer fills in registration form
2. customer receives email from hikashop to verify registration
3. Admin receives email from hikashop with the username and password
4. Customer clicks on the user activation link in his email
5. Admin receives email from Joomla with an activation link
6. Admin clicks on the user activation link in his second email

Now, I must say that I was a bit hasty with a previous reply as the "User Account Admin" email in HikaShop doesn't really replaces Joomla's. It can be useful in some cases, but it's not a replacement for Joomla's admin activation email.
From what I understand reading you, you'll have to deactivate the "User Account Admin" email as you don't want it, and instead customize the Joomla admin email with the method I described in www.hikashop.com/forum/customers/904693-...min-mail.html#343041

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

Time to create page: 0.066 seconds
Powered by Kunena Forum