- Posts: 45
- Thank you received: 0
Show username in subject admin notification email
- Squashtoppertje
-
Topic Author
- Offline
Less
More
10 years 10 months ago #222396
by Squashtoppertje
Show username in subject admin notification email was created 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!
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.
10 years 10 months ago #222499
by nicolas
Replied by nicolas on topic Show username in subject admin notification email
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:
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.
- Squashtoppertje
-
Topic Author
- Offline
Less
More
- Posts: 45
- Thank you received: 0
10 years 9 months ago #223858
by Squashtoppertje
Replied by Squashtoppertje on topic Show username in subject admin notification email
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!
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.
10 years 9 months ago #223898
by nicolas
Replied by nicolas on topic Show username in subject admin notification email
Hi,
I would rather recommend to add it at the beginning of the preload.
I would rather recommend to add it at the beginning of the preload.
Please Log in or Create an account to join the conversation.
- Squashtoppertje
-
Topic Author
- Offline
Less
More
- Posts: 45
- Thank you received: 0
10 years 9 months ago #224097
by Squashtoppertje
Replied by Squashtoppertje on topic Show username in subject admin notification email
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.
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.
10 years 9 months ago #224115
by nicolas
Replied by nicolas on topic Show username in subject admin notification email
Hi,
My bad, I made a mistake.
Try like this instead:
<?php $data->mail->subject = 'new order for user '.$data->customer->username; ?>
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.
- Squashtoppertje
-
Topic Author
- Offline
Less
More
- Posts: 45
- Thank you received: 0
10 years 9 months ago #224214
by Squashtoppertje
Replied by Squashtoppertje on topic Show username in subject admin notification email
Hi Nicolas,
No, this doesn't work either. Nothing happens. Below is the start of my preload code:
Any other ideas?
Thanks!
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.
Less
More
- Posts: 12953
- Thank you received: 1778
10 years 9 months ago #225641
by Mohamed Thelji
Replied by Mohamed Thelji on topic Show username in subject admin notification email
Hello,
Sorry for the late reply, If you still have that issue, can you try it with that code :
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.
- Squashtoppertje
-
Topic Author
- Offline
Less
More
- Posts: 45
- Thank you received: 0
10 years 8 months ago #226567
by Squashtoppertje
Replied by Squashtoppertje on topic Show username in subject admin notification email
Hi Mohamed,
This is the solution. Great, thanks!
Have a nice weekend!
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