Results 1 to 5 of 5
  1. #1

    Default Add field into order success email - code not working

    Hi guys,

    I am trying to add the customer login email address to the top of the the order success email.

    Currently the customer login email is in the footer under the "office use only" section.

    I have attempted to code it in just under the $EMAIL_FIRST_NAME $EMAIL_LAST_NAME, section of the email.

    What I have tried thus far:

    Under classes/order.php I have added the line in red:

    $html_msg['EMAIL_FIRST_NAME'] = $this->customer['firstname'];
    $html_msg['EMAIL_LAST_NAME'] = $this->customer['lastname'];
    $html_msg['EMAIL_CUSTOMER_EMAIL'] = $this->customer['login_email'];

    Within the email/email_template_checkout.html I have added the following in red:

    $EMAIL_FIRST_NAME $EMAIL_LAST_NAME,<br />
    $EMAIL_CUSTOMER_EMAIL<br />

    However when checking the success order email nothing is showing.

    If someone could assist me it would be much appreciated.

    Thanks,

    Elliot

  2. #2
    Join Date
    Jan 2004
    Posts
    66,364
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Add field into order success email - code not working

    In the order class, the customer's email address is found in $this->customer['email_address']. 'login_email' won't exist. Hence seeing nothing.
    .

    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

    Default Re: Add field into order success email - code not working

    Quote Originally Posted by DrByte View Post
    In the order class, the customer's email address is found in $this->customer['email_address']. 'login_email' won't exist. Hence seeing nothing.
    Thank you for your speedy reply! I had also tried using the 'email_address' but this showed nothing. I looked at the bottom of the email and found this:

    Office Use Only:
    From:
    Email:
    Login Name: Test na
    Login Email: [email protected]
    Telephone: 0123456789
    IP Address:
    Host Address:
    Date and Time: Tue Jan 22 2013 18:10:06 UTC

    I saw that the "From" and "Email" were blank so assumed that this is why your suggestion may not have worked thus me trying to utilise the 'login_email' which i found through developers tool kit (obviously didn't work lol)

    So even with this change:

    $html_msg['EMAIL_FIRST_NAME'] = $this->customer['firstname'];
    $html_msg['EMAIL_LAST_NAME'] = $this->customer['lastname'];
    $html_msg['EMAIL_CUSTOMER_EMAIL'] = $this->customer['email_address'];

    The email address is still not showing up, is there anything I am missing?

    Thanks.

  4. #4
    Join Date
    Jan 2004
    Posts
    66,364
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Add field into order success email - code not working

    These changes you're making will only work for HTML-formatted emails. They will have no effect on text-only emails.

    Plus, $EMAIL_TO_ADDRESS is already generally available, so isn't really necessary to set up $EMAIL_CUSTOMER_EMAIL for that.
    So, in your email template file, use $EMAIL_TO_ADDRESS instead

    For TEXT-ONLY emails, you'd need to remove your other changes from order.php and change this instead:
    Code:
        //intro area
        $email_order = EMAIL_TEXT_HEADER . EMAIL_TEXT_FROM . STORE_NAME . "\n\n" .
        $this->customer['firstname'] . ' ' . $this->customer['lastname'] . "\n\n" .
        EMAIL_THANKS_FOR_SHOPPING . "\n" . EMAIL_DETAILS_FOLLOW . "\n" .
    to
    Code:
        //intro area
        $email_order = EMAIL_TEXT_HEADER . EMAIL_TEXT_FROM . STORE_NAME . "\n\n" .
        $this->customer['email_address'] . "\n\n" .
        EMAIL_THANKS_FOR_SHOPPING . "\n" . EMAIL_DETAILS_FOLLOW . "\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.

  5. #5

    Default Re: Add field into order success email - code not working

    Absolutely fantastic help as always.

    Thank you very much.

    My final solution was:

    $this->customer['firstname'] . ' ' . $this->customer['lastname'] . "\n" . $this->customer['email_address'] . "\n\n" .

 

 

Similar Threads

  1. v138a Getting Secure Trading Auth code into the admin order email output
    By dgent in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 13 Nov 2014, 07:19 PM
  2. hard code url into order confirmation email
    By gsdcypher in forum General Questions
    Replies: 0
    Last Post: 10 Dec 2010, 09:06 PM
  3. Customize Order Confirmation Email - Add Field
    By Toot4fun in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 28 Mar 2010, 08:00 PM
  4. Replies: 0
    Last Post: 28 Feb 2008, 03:42 PM
  5. Order Confirmation Success Email
    By KaworuNagisa in forum Templates, Stylesheets, Page Layout
    Replies: 4
    Last Post: 14 Dec 2007, 08:50 PM

Bookmarks

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
Zen-Cart, Internet Selling Services, Klamath Falls, OR