Page 1 of 1

How to add "Hi 'firstname' ..." to emails

Posted: Thu Sep 28, 2017 2:54 pm
by v1ppers0nn
Hi, i want to add to any email the first name of the buyer. Can someone help me? I try with this: http://forum.opencart.com/viewtopic.php?f=20&t=41057 but not is working. I am with 2.3.0.2.

Re: How to add "Hi 'firstname' ..." to emails

Posted: Thu Sep 28, 2017 6:17 pm
by paulfeakins
It's not really an easy thing to explain in a forum post, but you need to decide on a string to be replaced with the first name, something like {first_name}. Then you need to find the bit of code where emails are sent and run the content of the email through a php funtion like str_replace and replace {first_name} with the content of the variable that contains the customer name.

Unless you're happy doing this coding you're best finding a developer from the Commercial Support Forum to do this, or looking for a Mail Merge extension in the marketplace.

Re: How to add "Hi 'firstname' ..." to emails

Posted: Fri Sep 29, 2017 2:44 pm
by v1ppers0nn
I think not is hard to make this, just 1-2 lines of code to add on the language/email and on the function. I want to get the first name of the order and add it on the begin, like Hello "firstname", ....