- Posts: 24
- Thank you received: 0
Use Guest Name in customer emails
9 years 5 months ago #267002
by gojyuan
Use Guest Name in customer emails was created by gojyuan
-- HikaShop version -- : 3.0.1 Business
-- Joomla version -- : 3.6.5
-- PHP version -- : 5.6.29
Hi,
We are using guest checkout only I and would like to populate the email To Name with the customers name from the address table.
Also could you please tell me where the HTML customisation and preload customisation files are stored. When searching for code it is easier to do it outside of the back end using an editor search option.
Much appreciated.
Regards
Linda
-- Joomla version -- : 3.6.5
-- PHP version -- : 5.6.29
Hi,
We are using guest checkout only I and would like to populate the email To Name with the customers name from the address table.
Also could you please tell me where the HTML customisation and preload customisation files are stored. When searching for code it is easier to do it outside of the back end using an editor search option.
Much appreciated.
Regards
Linda
Please Log in or Create an account to join the conversation.
9 years 5 months ago #267044
by nicolas
Replied by nicolas on topic Use Guest Name in customer emails
Hi,
You can add such code to the email and that should do it:
<?php $data->customer->name = @$data->cart->billing_address->address_title." ".@$data->cart->billing_address->address_firstname." ".@$data->cart->billing_address->address_lastname; ?>
They are stored in media/com_hikashop/mail/
You can add such code to the email and that should do it:
<?php $data->customer->name = @$data->cart->billing_address->address_title." ".@$data->cart->billing_address->address_firstname." ".@$data->cart->billing_address->address_lastname; ?>
They are stored in media/com_hikashop/mail/
Please Log in or Create an account to join the conversation.
9 years 5 months ago #267115
by gojyuan
Replied by gojyuan on topic Use Guest Name in customer emails
HI,
Thank you. I wasn't very clear with my question.
I am using HikaMarket and my vendors will be sending customer emails from the vendor control panel in the front end. I can see the email is generated from HikaShop ( blue ) and the popup box has the guest email ( To Address ) and a blank To Name. I wanted to fill the name with the guest name from the billing address.
Also the email is being sent from the vendor. The email is picking up the store name. I have tried to change the 'regards' to use the vendor name but do not know where it may be stored. I have tried $data->vendor->vendor_name and $data->order->vendor->vendor_name with no luck.
This is the original code
JText::sprintf('BEST_REGARDS_CUSTOMER',$mail->from_name),
Thank you.
Thank you. I wasn't very clear with my question.
I am using HikaMarket and my vendors will be sending customer emails from the vendor control panel in the front end. I can see the email is generated from HikaShop ( blue ) and the popup box has the guest email ( To Address ) and a blank To Name. I wanted to fill the name with the guest name from the billing address.
Also the email is being sent from the vendor. The email is picking up the store name. I have tried to change the 'regards' to use the vendor name but do not know where it may be stored. I have tried $data->vendor->vendor_name and $data->order->vendor->vendor_name with no luck.
This is the original code
JText::sprintf('BEST_REGARDS_CUSTOMER',$mail->from_name),
Thank you.
Please Log in or Create an account to join the conversation.
9 years 5 months ago #267116
by Jerome
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.
Replied by Jerome on topic Use Guest Name in customer emails
Hello,
In the email preload, you can access to the $mail object which contains the different values for the email address and the name.
You can modify these values in the preload and they will be used afterwards when the email is sent.
If you want to sign with the vendor name, it will be more complicated because you're in an HikaShop email (so in the HikaShop context) ; the order is the customer order and not the vendor one, so the vendor information cannot be reach like that (specially if the order can have products of several vendors in the same time).
Regards,
In the email preload, you can access to the $mail object which contains the different values for the email address and the name.
You can modify these values in the preload and they will be used afterwards when the email is sent.
Code:
$mail->dst_name = @$data->cart->billing_address->address_firstname;
If you want to sign with the vendor name, it will be more complicated because you're in an HikaShop email (so in the HikaShop context) ; the order is the customer order and not the vendor one, so the vendor information cannot be reach like that (specially if the order can have products of several vendors in the same time).
Regards,
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.
Please Log in or Create an account to join the conversation.
Time to create page: 0.196 seconds