Page 1 of 1

How to add customer name to the notification email.

Posted: Mon Oct 31, 2011 10:11 am
by perezosogato
hi guys,

how to add the customer name to the email ?
As we all know that the order update email starts with a greeting, but it is supposed to have the customer name ??
Such as,
" Dear John Smith,

Thank you for your interest in Your Store products. Your order has been received and will be processed once payment has been confirmed.

..."

but how to add the Dear John Smith ( customer name ) to the email as an addressing ?

Thank you.

Re: How to add customer name to the notification email.

Posted: Mon Oct 31, 2011 4:43 pm
by Jeremy Fisk
Just add in a new php echo before the greeting echo

Re: How to add customer name to the notification email.

Posted: Mon Oct 31, 2011 5:21 pm
by uksitebuilder
If you are talking about the Confirmation Order, then it's a little more than just echoing some php and probably means nothing to the OP if they dont know PHP code

edit catalog/language/english/mail/order.php

find

Code: Select all

$_['text_new_greeting']         = 'Thank you for your interest in %s products. Your order has been received and will be processed once payment has been confirmed.';
change to

Code: Select all

$_['text_new_greeting']         = 'Dear %s,<br /><br />Thank you for your interest in %s products. Your order has been received and will be processed once payment has been confirmed.';
edit: catalog/model/checkout/order.php

find

Code: Select all

$template->data['text_greeting'] = sprintf($language->get('text_new_greeting'), html_entity_decode($order_info['store_name'], ENT_QUOTES, 'UTF-8'));
change to

Code: Select all

$template->data['text_greeting'] = sprintf($language->get('text_new_greeting'), $order_info['payment_firstname']. ' ' . $order_info['payment_lastname'], html_entity_decode($order_info['store_name'], ENT_QUOTES, 'UTF-8'));
find

Code: Select all

$text  = sprintf($language->get('text_new_greeting'), html_entity_decode($order_info['store_name'], ENT_QUOTES, 'UTF-8')) . "\n\n";
change to

Code: Select all

$text  = sprintf($language->get('text_new_greeting'), $order_info['payment_firstname']. ' ' . $order_info['payment_lastname'], html_entity_decode($order_info['store_name'], ENT_QUOTES, 'UTF-8')) . "\n\n";

Re: How to add customer name to the notification email.

Posted: Mon Oct 31, 2011 7:50 pm
by Maansy
This should be how any email sent out from the store. I believe it's more professional when greeting using the customer's name.
Maybe Daniel will just throw it in while at it ;)

Re: How to add customer name to the notification email.

Posted: Mon Oct 31, 2011 10:52 pm
by perezosogato
uksitebuilder wrote:If you are talking about the Confirmation Order, then it's a little more than just echoing some php and probably means nothing to the OP if they dont know PHP code

edit catalog/language/english/mail/order.php

find

Code: Select all

$_['text_new_greeting']         = 'Thank you for your interest in %s products. Your order has been received and will be processed once payment has been confirmed.';
change to

Code: Select all

$_['text_new_greeting']         = 'Dear %s,<br /><br />Thank you for your interest in %s products. Your order has been received and will be processed once payment has been confirmed.';
edit: catalog/model/checkout/order.php

find

Code: Select all

$template->data['text_greeting'] = sprintf($language->get('text_new_greeting'), html_entity_decode($order_info['store_name'], ENT_QUOTES, 'UTF-8'));
change to

Code: Select all

$template->data['text_greeting'] = sprintf($language->get('text_new_greeting'), $order_info['payment_firstname']. ' ' . $order_info['payment_lastname'], html_entity_decode($order_info['store_name'], ENT_QUOTES, 'UTF-8'));
find

Code: Select all

$text  = sprintf($language->get('text_new_greeting'), html_entity_decode($order_info['store_name'], ENT_QUOTES, 'UTF-8')) . "\n\n";
change to

Code: Select all

$text  = sprintf($language->get('text_new_greeting'), $order_info['payment_firstname']. ' ' . $order_info['payment_lastname'], html_entity_decode($order_info['store_name'], ENT_QUOTES, 'UTF-8')) . "\n\n";
Need i edit all the code ?? or just one is okay ? ;)

Re: How to add customer name to the notification email.

Posted: Tue Nov 01, 2011 2:57 am
by Jeremy Fisk
Another great post from uksitebuilder...

I have compiled it into a vqmod... please download and try out... (Please note that i haven't had time to try it out myself yet...

Chears

jem

Re: How to add customer name to the notification email.

Posted: Tue Nov 01, 2011 9:06 am
by perezosogato
uksitebuilder wrote:If you are talking about the Confirmation Order, then it's a little more than just echoing some php and probably means nothing to the OP if they dont know PHP code

edit catalog/language/english/mail/order.php

find

Code: Select all

$_['text_new_greeting']         = 'Thank you for your interest in %s products. Your order has been received and will be processed once payment has been confirmed.';
change to

Code: Select all

$_['text_new_greeting']         = 'Dear %s,<br /><br />Thank you for your interest in %s products. Your order has been received and will be processed once payment has been confirmed.';
edit: catalog/model/checkout/order.php

find

Code: Select all

$template->data['text_greeting'] = sprintf($language->get('text_new_greeting'), html_entity_decode($order_info['store_name'], ENT_QUOTES, 'UTF-8'));
change to

Code: Select all

$template->data['text_greeting'] = sprintf($language->get('text_new_greeting'), $order_info['payment_firstname']. ' ' . $order_info['payment_lastname'], html_entity_decode($order_info['store_name'], ENT_QUOTES, 'UTF-8'));
find

Code: Select all

$text  = sprintf($language->get('text_new_greeting'), html_entity_decode($order_info['store_name'], ENT_QUOTES, 'UTF-8')) . "\n\n";
change to

Code: Select all

$text  = sprintf($language->get('text_new_greeting'), $order_info['payment_firstname']. ' ' . $order_info['payment_lastname'], html_entity_decode($order_info['store_name'], ENT_QUOTES, 'UTF-8')) . "\n\n";
Hi uksitebuilder,

I followed the steps.
the customer address dislayed, but the invoice the the text footer was changed in the order confirm email. please find the attachment for reference.
hope to hear from you soon.

Re: How to add customer name to the notification email.

Posted: Tue Nov 01, 2011 9:48 am
by Jeremy Fisk
try the vqmod... (on your original files)

Re: How to add customer name to the notification email.

Posted: Tue Nov 01, 2011 9:53 am
by perezosogato
Jeremy Fisk wrote:try the vqmod... (on your original files)
Hi Jem,

thank you, i am trying on your solution and will let you know the result. ;)
thank you very much for your helps.

Re: How to add customer name to the notification email.

Posted: Tue Nov 01, 2011 10:13 am
by Jeremy Fisk
Please note that "my solution" is only UKSITEBUILDER's in a vqmod so that you don't have to edit any core files... and it eliminates any chances of coding errors... (providing that there are no errors in my vqmod)

Chears

jem

Re: How to add customer name to the notification email.

Posted: Tue Nov 01, 2011 5:56 pm
by rocket
Before I get stuck into using this, by chance, will this also add the customer name to the order confirmation email I receive?
I'm looking at setting this up so I have the customers name but I also want to add their email address to my order confirmation. Can someone help tell me which files I need to edit and what to put? If its a separate issue, I'll start a new thread.
Thanks

Re: How to add customer name to the notification email.

Posted: Tue Nov 01, 2011 9:46 pm
by uksitebuilder
If you mean the email you receive, then there is also a vqmod for changing the system to send you a duplicate HTML email of what the customer receives when they order

Use that with this one and it will also add their name to the email greeting

Re: How to add customer name to the notification email.

Posted: Tue Nov 01, 2011 10:38 pm
by rocket
uksitebuilder wrote:If you mean the email you receive, then there is also a vqmod for changing the system to send you a duplicate HTML email of what the customer receives when they order

Use that with this one and it will also add their name to the email greeting
I tried using the vQmod but I mine won't load anything! Tried it once for an import/export extension but nothing worked, had to manually code instead.
I didn't want to have all the details a customer gets as that was too much info, but I figured out a way to get what I wanted to work here http://forum.opencart.com/viewtopic.php?f=20&t=44841
Thanks anyway, now need to fix my vQmod!

Re: How to add customer name to the notification email.

Posted: Wed Nov 02, 2011 11:50 am
by perezosogato
Jeremy Fisk wrote:try the vqmod... (on your original files)
hi Jem,

i got the same result that the customized footer does not display. see the attachment.
please help, thank.

Re: How to add customer name to the notification email.

Posted: Wed Apr 18, 2012 4:56 am
by SandCarver
Thanks Jeremy and UKSiteBuilder for teaming up and making this change a quick one!

Re: How to add customer name to the notification email.

Posted: Mon May 26, 2014 7:15 am
by IP_CAM
Great Solutuion, saved me much time! Thank you, uksitebuilder!
Ernie
OpenShop v1.7 (OC v.1.5.6.1-2-3-4)
---
$_['text_new_greeting'] = 'Dear %s,<br><br>Thank you for your interest in and order by %s . Your order .....
$_['text_new_greeting'] = 'Hallo %s,<br><br>Vielen Dank für Ihr Interesse und Ihre Bestellung bei %s. Wir haben .....
---
Image

ipc.li/shop/

Re: How to add customer name to the notification email.

Posted: Mon May 26, 2014 10:16 am
by ocaddons
@perezosogato

Did you install the vqmod for your store? If it is installed, i prefer to send you a xml file for adding the customer name into the email without touching the core code.