Order email from field to show user's name and ema

  • Posts: 24
  • Thank you received: 0
10 years 11 months ago #174227

-- url of the page with the problem -- : teszt2.honlapkeszitespecs.hu/
-- HikaShop version -- : 2.3.3
-- Joomla version -- : 2.3.6

Hi!
Is there a chance to set the order email that goes to the administrator, to show the email and the name of the registered user?
Thanks!

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

  • Posts: 13201
  • Thank you received: 2322
10 years 11 months ago #174236

Hi,

Yes you can edit it through the menu System > Emails and then edit the html part of the desired email.
In this part, you can add tags like:

{VAR:CUSTOMER_DETAILS}

But these informations should already be present in the emails by default.

Which email exactly you want to edit ?

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

  • Posts: 24
  • Thank you received: 0
10 years 11 months ago #174461

Hi Xavier!
I would like to edit the one that goes to the administrator when an order comes in.
I think it is the Order administrator notification.
My problem, is, that in the html part I can set the body of the email. But I would like to set the from field of the email to the actual email an name of the customer placed the order.
I have attached a screenshot.

Thanks!

Attachments:

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

  • Posts: 13201
  • Thank you received: 2322
10 years 11 months ago #174515

Hi,

Ok so you want to simulate that the email is sent by the customer himself ?
You will have to add some php in the email. Something like:

<?php
$userInfos = $userClass->get($data->order_user_id);
$mailer = JFactory::getMailer();
$mailer ->from_name = $userInfos->user_name;
$mailer ->from_email = $userInfos->user_email;
?>

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

  • Posts: 24
  • Thank you received: 0
10 years 11 months ago #174677

Hi Xavier!

Yes, that is what I would like to do. Where exactly do I have to include that php code? I have tried to place it in the Preload and in the HTML part, but without success.

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

  • Posts: 84301
  • Thank you received: 13697
  • MODERATOR
10 years 11 months ago #174894

Hi,

I think that it will work better by adding such code at the end of the preload:

<?php
$userInfos = $userClass->get($data->order_user_id);
$mail ->from_name = $userInfos->user_name;
$mail ->from_email = $userInfos->user_email;
?>

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

  • Posts: 24
  • Thank you received: 0
10 years 11 months ago #174915

Hi Nicolas!
I have placed the code at the end of the preload version.
Unfortunately now the email is not going out.
What did I do wrong?

Attachments:

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

  • Posts: 13201
  • Thank you received: 2322
10 years 11 months ago #174921

Hi,

Potentially because there is an error, there is a space between "$mail" and "->from_...".
Please remove this space.

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

  • Posts: 24
  • Thank you received: 0
10 years 11 months ago #175081

Hi!
Ok, I've got it!!
It was
$mail->from_name = $userInfos->name;
not
$mail->from_name = $userInfos->user_name;

It works now, thank you very much!

Last edit: 10 years 11 months ago by ketsh.

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

  • Posts: 13201
  • Thank you received: 2322
10 years 11 months ago #175085

Hi,

Could you try with that:

<?php
$userInfos = $userClass->get($data->order_user_id);
$mailer = JFactory::getMailer();
$mailer->from_name = $userInfos->user_name;
$mailer->from_email = $userInfos->user_email;
?>
There was spaces too in the code given previously.

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

Time to create page: 0.114 seconds
Powered by Kunena Forum