Admin Notification: Include email address of user

  • Posts: 13
  • Thank you received: 1
  • Hikashop Business
3 hours 28 minutes ago #372254

-- url of the page with the problem -- : wmrhill.com/quote-request-shopping-cart/checkout
-- HikaShop version -- : 6.5.0
-- Joomla version -- : 6.1.0
-- PHP version -- : 8.3
-- Browser(s) name and version -- : Chrome Version 149.0.7827.54 and Firefox Version 149.0.7827.54
-- Error-message(debug-mod must be tuned on) -- : No error.

Hi there! Thank you for your time. My client receives the admin notification and I get cc'ed on the order notification.

Right now, there is no email address showing up inside the body of the admin notification, so there is no way to respond to the user who sent the quote request.

--- 2QUESTIONS ---
1) Which {tag} do I use to populate it
2) Do I populate it in all 3 PHP files?

--- WHAT I ATTEMPTED ---
I downloaded:
order_admin_notification.html.modified.php
order_admin_notification.preload.modified.php
order_admin_notification.text.modified.php

I placed the email address in this area of the code:
<p>
<span class="hika_template_color" style="font-size:12px;font-weight:bold;">
{TXT:BILLING_ADDRESS}</span><br/>
{VAR:BILLING_ADDRESS}<br/>
{billing_address.address_email}
</p>

Before that, I tried using USER_EMAIL.

I feel like I'm super close to solving it, but can't seem to get there.
- Mary

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

  • Posts: 85728
  • Thank you received: 14057
  • MODERATOR
41 minutes ago #372256

Hi,

Good news: the buyer's email is already available in that email, you do not need a new tag for it. The default admin notification has a "Customer:" line that outputs it through this tag:

{VAR:CUSTOMER_DETAILS}

That variable holds the email of the user account attached to the order, so you can place {VAR:CUSTOMER_DETAILS} anywhere you want the email to show in the HTML body. If nothing appears on your side, that line was most likely removed from your customized template, so just add the tag back where you need it.

Why your attempts came out empty:
- The HTML body only understands HikaShop tags written as {VAR:NAME} or {TXT:NAME}, which map to variables prepared in the preload file. {billing_address.address_email} and USER_EMAIL are not defined variables, so they render as nothing.
- There is also no email field on the address in HikaShop. The email is stored on the user account, which is exactly what CUSTOMER_DETAILS reads.

On your second question, no, you do not populate all three files for this. They have different roles:
- order_admin_notification.preload.php prepares the data (the {VAR:...} variables).
- order_admin_notification.html.php is the HTML layout (uses {VAR:...} / {TXT:...} tags).
- order_admin_notification.text.php is the plain-text layout (plain PHP, you echo values directly).

You only add the {VAR:...} tag in the HTML layout (and, if your customers also receive the plain-text part, one echo line in the text layout). You edit the preload only when you need to create a brand new variable, which is not needed here since CUSTOMER_DETAILS already exists.

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

Time to create page: 0.056 seconds
Powered by Kunena Forum