Results 1 to 9 of 9
  1. #1
    Join Date
    Apr 2010
    Posts
    900
    Plugin Contributions
    0

    Default Can I address BOTH first/last name in email?

    Hi!

    I have scoured the tutorials and forum, yet cannot figure out how to fix this: my emails address customer by first name only.

    I disabled the Mr/Ms function because about 40% of my customers are doctors. And I do not wish to send informal emails (first name only) to customers who I have not yet earned such familiarity with.

    I was able to customize my Welcome email by editing this file:
    includes/languages/english/create_account.php

    The following code appears to control the issue:
    // greeting salutation

    define('EMAIL_SUBJECT', 'Welcome to ' . STORE_OWNER);

    define('EMAIL_GREET_MR', 'Dear Mr. %s,' . "\n\n");

    define('EMAIL_GREET_MS', 'Dear Ms. %s,' . "\n\n");

    define('EMAIL_GREET_NONE', 'Dear %s' . "\n\n");



    // First line of the greeting

    define('EMAIL_WELCOME', 'We wish to welcome you to the <strong>MedHarvest</strong> family of online stores.');
    I cannot figure out where EMAIL_WELCOME gets defined! I used the Developer Tool search, found references to it but cannot figure out where I can tell it first_name last_name.

    Any help would be very appreciated!

  2. #2
    Join Date
    Jan 2004
    Posts
    66,443
    Plugin Contributions
    279

    Default Re: Can I address BOTH first/last name in email?

    You'll have to hard-code the changes into /includes/modules/create_account.php
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  3. #3
    Join Date
    Apr 2010
    Posts
    900
    Plugin Contributions
    0

    Default Re: Can I address BOTH first/last name in email?

    Wow! That is twice in one day! Thanks for helping me again, DrByte.

    I found this:
    // build the message content

    $name = $firstname . ' ' . $lastname;



    if (ACCOUNT_GENDER == 'true') {

    if ($gender == 'm') {

    $email_text = sprintf(EMAIL_GREET_MR, $lastname);

    } else {

    $email_text = sprintf(EMAIL_GREET_MS, $lastname);

    }

    } else {

    $email_text = sprintf(EMAIL_GREET_NONE, $firstname);

    }

    $html_msg['EMAIL_GREETING'] = str_replace('\n','',$email_text);

    $html_msg['EMAIL_FIRST_NAME'] = $firstname;

    $html_msg['EMAIL_LAST_NAME'] = $lastname;
    Changed the bolded passage to:
    $email_text = sprintf(EMAIL_GREET_NONE, $name);

    This seemed to work. But now the problem is that there is no comma after the customers name. lololol... if it ain't one ting, its ta'other!

  4. #4
    Join Date
    Apr 2010
    Posts
    900
    Plugin Contributions
    0

    Default Re: Can I address BOTH first/last name in email?

    Any idea on how I can add the punctuation?

    I would like my email to read:

    Dear John Smith,

    I think I need to put in one of the two passages I quoted above. I don't know which, where or how.

    By how, I mean I don't know how to code it in, even if I knew where to put it. I can kind of understand what php is doing, but I can only copy and paste it.

    For instance, I understood the big clue to fix my first problem was this:
    $name = $firstname . ' ' . $lastname;

    Then I just had to copy/paste.

    Hate to bug again, but can you help one more time?

  5. #5
    Join Date
    Jan 2004
    Posts
    66,443
    Plugin Contributions
    279

    Default Re: Can I address BOTH first/last name in email?

    Add your comma in the language file, after the %s:
    Code:
    define('EMAIL_GREET_NONE', 'Dear %s,' . "\n\n");
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  6. #6
    Join Date
    Apr 2010
    Posts
    900
    Plugin Contributions
    0

    Default Re: Can I address BOTH first/last name in email?

    You are the greatest! Thank you so much!


  7. #7
    Join Date
    May 2010
    Posts
    14
    Plugin Contributions
    0

    Default Re: Can I address BOTH first/last name in email?

    Hello,

    I have a similar predicament that involves the first name last name error.

    It seems as though my email greetings aren't consistent. On some, the $EMAIL_FIRST_NAME $EMAIL_LAST_NAME command works fine; such as in the email_template_checkout.html and the email_template_gv_mail.html

    However, in my email template_order_status.html which calls the same command line, it displays the text $EMAIL_FIRST_NAME $EMAIL_LAST_NAME - not the customer's name.

    I don't know what's causing this problem on this particular template. Help..

    - Saydie

  8. #8
    Join Date
    Jan 2004
    Posts
    66,443
    Plugin Contributions
    279

    Default Re: Can I address BOTH first/last name in email?

    That's because the Admin order-status emails are built to use $EMAIL_CUSTOMERS_NAME which is the name of the customer as stored in the order details in the database.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  9. #9
    Join Date
    May 2010
    Posts
    14
    Plugin Contributions
    0

    Default Re: Can I address BOTH first/last name in email?

    I see! Thanks for the clarification Dr Byte!!

 

 

Similar Threads

  1. v151 Customers Name - Last Name, First Name
    By cjcraven in forum General Questions
    Replies: 8
    Last Post: 14 May 2014, 04:08 PM
  2. Can I Address only First name in Welcome Message?
    By adem.i in forum Customization from the Admin
    Replies: 2
    Last Post: 16 Jan 2012, 04:38 PM
  3. customer review first name last initial
    By shoesocks.com in forum Setting Up Categories, Products, Attributes
    Replies: 1
    Last Post: 23 Feb 2010, 06:24 AM
  4. switch the display of order of first name and last name on each address
    By weber in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 21 Nov 2008, 07:34 PM
  5. Admin Customer Name, First/Last reversed
    By Peace Freak in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 3 Sep 2006, 08:03 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg