[Skip to main content](#vessel-content)

#   Changing the customers name in emails

##

- **[rossdesigns](/forum/user/7055-rossdesigns "View rossdesigns's Profile")**
- [![rossdesigns's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/7055-rossdesigns "View rossdesigns's Profile") Topic Author
- [ Offline](/forum/user/7055-rossdesigns)

Less More

- Posts: 16
- Thank you received: 0
-
-

14 years 3 months ago [\#60752](#60752) by [rossdesigns](/forum/user/7055-rossdesigns "View rossdesigns's Profile")  *[Changing the customers name in emails](/forum/4-how-to/60752-changing-the-customers-name-in-emails#60752 "Hi, I have a site where there is no registration at checkout.  This has resulted in the emails for 'order creation notification' and 'order status notification' having 'Hi ,' at the start of the email.  To have the email start with 'Hi &#91;billing address-&gt;first name&#93;,' what do I need to change in the code: echo JText::sprintf('HI&#95;CUSTOMER',@$data-&gt;customer-&gt;name);?&gt; and echo JText::sprintf('HI&#95;CUSTOMER',@$customer-&gt;name);?&gt;  Thanks, Geoff")* was created by *[rossdesigns](/forum/user/7055-rossdesigns "View rossdesigns's Profile")*

Hi,
I have a site where there is no registration at checkout.

This has resulted in the emails for 'order creation notification' and 'order status notification' having 'Hi ,' at the start of the email.

To have the email start with 'Hi *\[billing address-&gt;first name\]*,' what do I need to change in the code:
echo JText::sprintf('HI_CUSTOMER',@$data-&gt;customer-&gt;name);?&gt;
and
echo JText::sprintf('HI_CUSTOMER',@$customer-&gt;name);?&gt;

Thanks,
Geoff

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzYwNzUyLWNoYW5naW5nLXRoZS1jdXN0b21lcnMtbmFtZS1pbi1lbWFpbHM/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Jerome](/forum/user/80-jerome "View Jerome's Profile")**
- [![Jerome's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar80.png)](/forum/user/80-jerome "View Jerome's Profile")
- [ Offline](/forum/user/80-jerome)
- HikaShop core developer

Less More

- Posts: 26401
- Thank you received: 4081
-
- [](http://obsi.dev)
-

14 years 3 months ago [\#60754](#60754) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[Re: Changing the customers name in emails](/forum/4-how-to/60752-changing-the-customers-name-in-emails#60754 "Hi, I have a site where there is no registration at checkout.  This has resulted in the emails for 'order creation notification' and 'order status notification' having 'Hi ,' at the start of the email.  To have the email start with 'Hi &#91;billing address-&gt;first name&#93;,' what do I need to change in the code: echo JText::sprintf('HI&#95;CUSTOMER',@$data-&gt;customer-&gt;name);?&gt; and echo JText::sprintf('HI&#95;CUSTOMER',@$customer-&gt;name);?&gt;  Thanks, Geoff")*

Hi,

In the creation notification and status notification emails you can use: Code:

echo @$data-&gt;cart-&gt;billing_address-&gt;address_firstname;

Regards,

---

Jerome - Obsidev.com
HikaMarket &amp; HikaSerial developer / HikaShop core dev team.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzYwNzUyLWNoYW5naW5nLXRoZS1jdXN0b21lcnMtbmFtZS1pbi1lbWFpbHM/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[rossdesigns](/forum/user/7055-rossdesigns "View rossdesigns's Profile")**
- [![rossdesigns's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/7055-rossdesigns "View rossdesigns's Profile") Topic Author
- [ Offline](/forum/user/7055-rossdesigns)

Less More

- Posts: 16
- Thank you received: 0
-
-

14 years 3 months ago [\#60797](#60797) by [rossdesigns](/forum/user/7055-rossdesigns "View rossdesigns's Profile")  Replied by *[rossdesigns](/forum/user/7055-rossdesigns "View rossdesigns's Profile")* on topic *[Re: Changing the customers name in emails](/forum/4-how-to/60752-changing-the-customers-name-in-emails#60797 "Hi, I have a site where there is no registration at checkout.  This has resulted in the emails for 'order creation notification' and 'order status notification' having 'Hi ,' at the start of the email.  To have the email start with 'Hi &#91;billing address-&gt;first name&#93;,' what do I need to change in the code: echo JText::sprintf('HI&#95;CUSTOMER',@$data-&gt;customer-&gt;name);?&gt; and echo JText::sprintf('HI&#95;CUSTOMER',@$customer-&gt;name);?&gt;  Thanks, Geoff")*

Thanks Jerome

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzYwNzUyLWNoYW5naW5nLXRoZS1jdXN0b21lcnMtbmFtZS1pbi1lbWFpbHM/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Rolandus1](/forum/user/6166-rolandus1 "View Rolandus1's Profile")**
- [![Rolandus1's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/6166-rolandus1 "View Rolandus1's Profile")
- [ Offline](/forum/user/6166-rolandus1)

Less More

- Posts: 61
- Thank you received: 1
-
-

14 years 1 month ago [\#69683](#69683) by [Rolandus1](/forum/user/6166-rolandus1 "View Rolandus1's Profile")  Replied by *[Rolandus1](/forum/user/6166-rolandus1 "View Rolandus1's Profile")* on topic *[Re: Changing the customers name in emails](/forum/4-how-to/60752-changing-the-customers-name-in-emails#69683 "Hi, I have a site where there is no registration at checkout.  This has resulted in the emails for 'order creation notification' and 'order status notification' having 'Hi ,' at the start of the email.  To have the email start with 'Hi &#91;billing address-&gt;first name&#93;,' what do I need to change in the code: echo JText::sprintf('HI&#95;CUSTOMER',@$data-&gt;customer-&gt;name);?&gt; and echo JText::sprintf('HI&#95;CUSTOMER',@$customer-&gt;name);?&gt;  Thanks, Geoff")*

Hi refreshing this thread:

I put the following line in the "Order creation notification" template
&lt;?php echo JText::sprintf('HI_CUSTOMER',@$data-&gt;cart-&gt;billing_address-&gt;address__title."&amp;nbsp;".@$data-&gt;customer-&gt;name);?&gt;

In the e-mail to the customer the output is ""Hello Mr. XXXYYY".
But my Page is in German and the Shop (Select in Registration and Output auf Title in the shipping Adress) is korrect in German (Herr, Frau).
What I have to do, to get in the email the German Traslation of what User see on Webpage in the Select (drop down) for the Titel (Mr, Ms)?

Thank you

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzYwNzUyLWNoYW5naW5nLXRoZS1jdXN0b21lcnMtbmFtZS1pbi1lbWFpbHM/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86564
- Thank you received: 14311
-
-

14 years 1 month ago -  10 years 8 months ago [\#69888](#69888) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: Changing the customers name in emails](/forum/4-how-to/60752-changing-the-customers-name-in-emails#69888 "Hi, I have a site where there is no registration at checkout.  This has resulted in the emails for 'order creation notification' and 'order status notification' having 'Hi ,' at the start of the email.  To have the email start with 'Hi &#91;billing address-&gt;first name&#93;,' what do I need to change in the code: echo JText::sprintf('HI&#95;CUSTOMER',@$data-&gt;customer-&gt;name);?&gt; and echo JText::sprintf('HI&#95;CUSTOMER',@$customer-&gt;name);?&gt;  Thanks, Geoff")*

Hi,

Instead of @$data-&gt;cart-&gt;billing_address-&gt;address_title, you should have:
JText::_(preg_replace('#[^a-z0-9]#i','_',strtoupper(@$data-&gt;cart-&gt;billing_address-&gt;address_title))

That will convert the data in the database, which is always in english, to the current language.

Last edit: 10 years 8 months ago by [nicolas](/forum/user/63-nicolas "View nicolas's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzYwNzUyLWNoYW5naW5nLXRoZS1jdXN0b21lcnMtbmFtZS1pbi1lbWFpbHM/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop Install &amp; Update Product &amp; Category Display Content Creation Sales and Orders Orders management Reports &amp; Statistics Customers Checkout Payment Methods Shipping Methods Import &amp; Export (CSV, XLS…) Specific Features Affilation Taxes Wishlist Vote Carousel &amp; Slider Mass Actions Filters &amp; Search Discount &amp; Coupon Feature Request Integrations Showcase General Talk about HikaShop Development HikaShop 3.0 Beta Translation Commercial Jobs HikaShop Components HikaMarket Market: Feature requests Market: How to? Market: Bug Report HikaSerial General talk about HikaSerial Serial: Bug Report Serial: How to? Support en Français de HikaSerial (French Support) HikaSubscription HikaAuction Auction: Feature requests Auction: How to? Auction: Bug report Hikashop around the world Support en Français (French Support) Russian FAQ. Курс выживания с Hikashop. Частые вопросы и о Расширения Hikashop Наши сайты на Hikashop 日本語版サポート(Japanese Support) Thai German Archives Bug Report How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.074 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)
