Skip to main content

Show username in subject admin notification email

More
10 years 10 months ago #222396 by Squashtoppertje
-- HikaShop version -- : 2.6.0. Business

Hi,

I want to show the customer name in the subject of the admin notification email. Is this possible? And how?

Thanks!

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

More
10 years 10 months ago #222499 by nicolas
Hi,

There is no option to do that.
You would have to modify the preload code of the email via the menu System>Emails in order to do that.
There, you could add such code:
Code:
<?php $data->mail->subject = 'new order for user '.$order->customer->username; ?>

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

More
10 years 9 months ago #223858 by Squashtoppertje
Hi Nicolas,

I tried your code in the preload code. I added it at the end, but it did not have any effect. I removed the original subjectline (ORDER_ADMIN_NOTIFICATION_SUBJECT).

Does the position matter?

Thanks!

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

More
10 years 9 months ago #223898 by nicolas
Hi,

I would rather recommend to add it at the beginning of the preload.

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

More
10 years 9 months ago #224097 by Squashtoppertje
Hi Nicolas,

I tried that also, but it didn't work. I removed the original subject line, but in the email the subject now is something like:

New order nr. xxxx generated on www.example.com (translated).

Do you have any other suggestions?

Thanks again.

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

More
10 years 9 months ago #224115 by nicolas
Hi,

My bad, I made a mistake.
Try like this instead:
<?php $data->mail->subject = 'new order for user '.$data->customer->username; ?>

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

More
10 years 9 months ago #224214 by Squashtoppertje
Hi Nicolas,

No, this doesn't work either. Nothing happens. Below is the start of my preload code:
Code:
/** * @package HikaShop for Joomla! * @version 2.6.0 * @author hikashop.com * @copyright (C) 2010-2015 HIKARI SOFTWARE. All rights reserved. * @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html */ defined('_JEXEC') or die('Restricted access'); ?> <?php $data->mail->subject = 'new order for user '.$data->customer->username; $app = JFactory::getApplication(); $config = hikashop_config(); $orderClass = hikashop_get('class.order'); $imageHelper = hikashop_get('helper.image'); $productClass = hikashop_get('class.product'); $fieldsClass = hikashop_get('class.field'); if(hikashop_level(2)) { $null = null; $itemFields = $fieldsClass->getFields('frontcomp',$null,'item'); }

Any other ideas?

Thanks!

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

More
10 years 9 months ago #225641 by Mohamed Thelji
Hello,
Sorry for the late reply, If you still have that issue, can you try it with that code :
Code:
<?php $mail->subject = 'new order for user '.$data->customer->username; ?>
The following user(s) said Thank You: pepecortez, Squashtoppertje

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

More
10 years 8 months ago #226567 by Squashtoppertje
Hi Mohamed,

This is the solution. Great, thanks!

Have a nice weekend!

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

Time to create page: 0.251 seconds
Powered by Kunena Forum