Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls

Changing Email Greeting to show First Name Only

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 05-14-2012, 07:58 PM
 
Henry Henry is offline
 

Advanced Member
  
Join Date: Mar 2009
Posts: 33
 

Default Changing Email Greeting to show First Name Only

When a customer places an order they will receive an email that contains their invoice and the following text:

Hello John Smith, Thank you for your order. Please come back soon!

When the order status is changed to complete they will receive their order has been completed email that has the following text:

Hi John Smith, Your order has been completed successfully.

I would like to have just the Customers First Name show on all emails. I changed the code in salutation.tpl to the following and the First Name will show on Order Completed Emails but on the email that contains their invoice it will just show "Hello ,"

---------------------------------------------------
{* $Id: salutation.tpl,v 1.1 2010/05/21 08:32:15 joy Exp $ *}
{strip}
{if $salutation ne ""}
{$lng.eml_dear|substitute:"customer":"`$customer.f irstname`"}
{else}
{if $firstname eq "" and $lastname eq ""}
{$lng.eml_dear|substitute:"customer":"`$customer.f irstname`"}
{else}
{$lng.eml_dear|substitute:"customer":"`$customer.f irstname`"}
{/if}
{/if}
{/strip},
-----------------------------------------------------

I did also try to change the Language variable in
eml_dear but I am not sure what to use to call out the First Name. I tried "firstname", "customer.firstname", ect but nothing worked.


Any help with this would be appreciated.

__________________
Hank
X-Cart 4.4.2
Reply With Quote
  #2  
Old 05-15-2012, 05:36 AM
  totaltec's Avatar 
totaltec totaltec is offline
 

X-Guru
  
Join Date: Jan 2007
Location: Louisville, KY USA
Posts: 5,823
 

Default Re: Changing Email Greeting to show First Name Only

Look at: /common_files/mail/html/order_customer.tpl

This line:
<br />{include file="mail/salutation.tpl" title=$order.title firstname=$order.firstname lastname=$order.lastname}

That should clear up what you need to do, if not just ask.
__________________
Mike White - Now Accepting new clients and projects! Work with the best, get a US based development team for just $125 an hour. Call 1-502-773-6454, email mike at babymonkeystudios.com, or skype b8bym0nkey

XcartGuru
X-cart Tutorials | X-cart 5 Tutorials

Check out the responsive template for X-cart.
Reply With Quote
  #3  
Old 05-15-2012, 05:58 AM
 
Henry Henry is offline
 

Advanced Member
  
Join Date: Mar 2009
Posts: 33
 

Default Re: Changing Email Greeting to show First Name Only

Hello,

Thank you for the reply. I looked at the code you indicated but I am not sure what you are pointing out. That is the same line of code that is also in common_files/mail/html/order_customer_complete and only the first name is showing on the completed emails. I am not sure if I am looking at this incorrectly but both of these files - order_customer and order_customer-complete are calling for the salutation.tpl file to be included in the email. Since I have the substitute code in the salutation.tpl file the first name should show on both emails.
__________________
Hank
X-Cart 4.4.2
Reply With Quote
  #4  
Old 05-15-2012, 09:34 AM
  totaltec's Avatar 
totaltec totaltec is offline
 

X-Guru
  
Join Date: Jan 2007
Location: Louisville, KY USA
Posts: 5,823
 

Default Re: Changing Email Greeting to show First Name Only

No problem. See this code from salutation.tpl:
PHP Code:
{if $salutation ne ""}
   {
$lng.eml_dear|substitute:"customer":$salutation}
{else}
   {if 
$firstname eq ""}
       {
$lng.eml_dear_customer}
   {else}
       {
$lng.eml_dear|substitute:"customer":"`$title` `$firstname` `$lastname`"}
   {/if}
{/if} 

In your example you are substituting "customer" with $customer.firstname.

When passed from /common_files/mail/html/order_customer.tpl the $customer array is not set. $order is what it is pulling from, as you can see from the scrap of code I posted above.

To accomplish your goal, I believe you only need to remove the reference to $title and $lastname in salutation.tpl. Like this:
PHP Code:
{strip}
{if 
$salutation ne ""}
   {
$lng.eml_dear|substitute:"customer":$salutation}
{else}
   {if 
$firstname eq "" and $lastname eq ""}
       {
$lng.eml_dear_customer}
   {else}
       {
$lng.eml_dear|substitute:"customer":"`$firstname`"}
   {/if}
{/if}
{/
strip}, 
__________________
Mike White - Now Accepting new clients and projects! Work with the best, get a US based development team for just $125 an hour. Call 1-502-773-6454, email mike at babymonkeystudios.com, or skype b8bym0nkey

XcartGuru
X-cart Tutorials | X-cart 5 Tutorials

Check out the responsive template for X-cart.
Reply With Quote

The following user thanks totaltec for this useful post:
Henry (05-15-2012)
  #5  
Old 05-15-2012, 09:41 AM
 
Henry Henry is offline
 

Advanced Member
  
Join Date: Mar 2009
Posts: 33
 

Default Re: Changing Email Greeting to show First Name Only

That was it. Thank you for the help on this one. This has been on my to do list for some time so thanks again!
__________________
Hank
X-Cart 4.4.2
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 07:18 AM.

   

 
X-Cart forums © 2001-2020