Results 1 to 7 of 7

Hybrid View

  1. #1
    Join Date
    Oct 2008
    Posts
    32
    Plugin Contributions
    0

    Default [NEW ORDER] Reply Email Address as Customer -- FIX!

    I searched everywhere for an answer for this, and all I found were closed threads with solutions that didn't work with the newer versions of Zen Cart.

    My issue was that I needed the "reply-to" address of the order copy emails to be that of the customer so my client could easily just hit the "reply" button in Outlook instead of going into the store's admin area and submitting a note to them that way. As it was, the reply address was set to the store's default email address, so clicking "reply" sent a message back to the store. Client was not happy about this as he hated having to copy and paste the email address from the order into the reply field of a new message. After much searching and trying solutions that just didn't work, I played around with the order.php file and have the solution here for anyone else who had been looking for a way to do this.

    at the bottom of includes/classes/order.php, find:

    Code:
    $email_order . $extra_info['TEXT'], STORE_NAME, EMAIL_FROM, $html_msg, 'checkout_extra', $this->attachArray);
    Replace with:

    Code:
    $email_order . $extra_info['TEXT'], $this->customer['firstname'] . ' ' . $this->customer['lastname'], $this->customer['email_address'], $html_msg, 'checkout_extra', $this->attachArray);
    This will show the "From" as the customer name instead of the store name, and the reply-to email as the customer, not the store.
    In your Admin > Email Options make sure "must send emails from known domain" is false.

    Hope it helps someone else!

  2. #2
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: [NEW ORDER] Reply Email Address as Customer -- FIX!

    Thanks for posting this! My partners have been bugging me to fix this annoying behavior.

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

    Default Re: [NEW ORDER] Reply Email Address as Customer -- FIX!

    Quote Originally Posted by evenangelsdie View Post
    This will show the "From" as the customer name instead of the store name, and the reply-to email as the customer, not the store.
    In your Admin > Email Options make sure "must send emails from known domain" is false.
    If that works for your specific case, fine.
    But beware of spam filters being triggered when you do that.
    You are essentially "spoofing" the email to make it "look like" it's coming from the customer by giving a fake "from" address when in fact it's actually coming from YOU (your store, ie: your store's domain name is different from the customer's domain name). Be prepared for the potential of lost or rejected (or worse, dropped without notice) emails.
    .

    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.

  4. #4
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: [NEW ORDER] Reply Email Address as Customer -- FIX!

    So is there any safe way around this? "Contact Us" e-mails are always from another person, even if they are sent through the store, and "reply" always wants to go by default to the person who wrote, not the store. Is there a way to make the reply-to match the writer's e-mail without spoofing the sent-from? Hitting reply and having the message not go to the desired recipient without remembering to copy and paste an address causes a lot of stress for ordinary staff.

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

    Default Re: [NEW ORDER] Reply Email Address as Customer -- FIX!

    Here's what I'm considering proposing for v1.6.0 ...

    orders.php:
    Code:
          $email_order . $extra_info['TEXT'], STORE_NAME, EMAIL_FROM, $html_msg, 'checkout_extra', $this->attachArray, $this->customer['firstname'] . ' ' . $this->customer['lastname'], $this->customer['email_address']);
    functions_email.php:
    Code:
      function zen_mail($to_name, $to_address, $email_subject, $email_text, $from_email_name, $from_email_address, $block=array(), $module='default', $attachments_list='', $email_reply_to_name = '', $email_reply_to_address = '' ) {
    and
    Code:
          // If sending from checkout or contact-us or tell-a-friend page, use the supplied info
          $email_reply_to_address = (isset($email_reply_to_address) && $email_reply_to_address != '') ? $email_reply_to_address : (in_array($module, array('contact_us',  'tell_a_friend', 'checkout_extra')) ? $from_email_address : EMAIL_FROM);
          $email_reply_to_name    = (isset($email_reply_to_name) && $email_reply_to_name != '')    ? $email_reply_to_name    : (in_array($module, array('contact_us',  'tell_a_friend', 'checkout_extra')) ? $from_email_name    : STORE_NAME);
    Feel free to try it out and report whether it solves the problem you're facing.
    .

    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
    Mar 2009
    Posts
    169
    Plugin Contributions
    2

    Default Re: [NEW ORDER] Reply Email Address as Customer -- FIX!

    Quote Originally Posted by DrByte View Post
    Here's what I'm considering proposing for v1.6.0 ...

    orders.php:
    Code:
          $email_order . $extra_info['TEXT'], STORE_NAME, EMAIL_FROM, $html_msg, 'checkout_extra', $this->attachArray, $this->customer['firstname'] . ' ' . $this->customer['lastname'], $this->customer['email_address']);
    functions_email.php:
    Code:
      function zen_mail($to_name, $to_address, $email_subject, $email_text, $from_email_name, $from_email_address, $block=array(), $module='default', $attachments_list='', $email_reply_to_name = '', $email_reply_to_address = '' ) {
    and
    Code:
          // If sending from checkout or contact-us or tell-a-friend page, use the supplied info
          $email_reply_to_address = (isset($email_reply_to_address) && $email_reply_to_address != '') ? $email_reply_to_address : (in_array($module, array('contact_us',  'tell_a_friend', 'checkout_extra')) ? $from_email_address : EMAIL_FROM);
          $email_reply_to_name    = (isset($email_reply_to_name) && $email_reply_to_name != '')    ? $email_reply_to_name    : (in_array($module, array('contact_us',  'tell_a_friend', 'checkout_extra')) ? $from_email_name    : STORE_NAME);
    Feel free to try it out and report whether it solves the problem you're facing.
    Works excellently DrByte, thank you so much for that!

  7. #7
    Join Date
    Oct 2008
    Posts
    32
    Plugin Contributions
    0

    Default Re: [NEW ORDER] Reply Email Address as Customer -- FIX!

    Quote Originally Posted by DrByte View Post
    If that works for your specific case, fine.
    But beware of spam filters being triggered when you do that.
    You are essentially "spoofing" the email to make it "look like" it's coming from the customer by giving a fake "from" address when in fact it's actually coming from YOU (your store, ie: your store's domain name is different from the customer's domain name). Be prepared for the potential of lost or rejected (or worse, dropped without notice) emails.
    Thank you, yes I took that into consideration. Unfortunately I couldn't find another way to do this and it was necessary. I had done something similar for him many years ago with an older version of Zencart and there were no issues with this fortunately. I'm not too worried, since Paypal is set as the default payment method anyways, and the Paypal order email would always still come through. So, even if an order email was marked as spam he would still know that there was an order because of the Paypal email. In that case he could just go through the admin area to retrieve it. If this is updated in the next version as you proposed that would be that would be great!

 

 

Similar Threads

  1. customizing order email, copy customer address + phone
    By fakeDecoy in forum General Questions
    Replies: 7
    Last Post: 20 Dec 2011, 09:16 PM
  2. Change Email Address on old customer order
    By ricangem in forum Managing Customers and Orders
    Replies: 3
    Last Post: 17 Oct 2011, 04:26 AM
  3. Order Confirmation email missing customer address?
    By azwli in forum General Questions
    Replies: 19
    Last Post: 6 Nov 2009, 06:58 AM
  4. Email copy of customer order to second email address
    By WHOSYOURDADDY in forum Customization from the Admin
    Replies: 2
    Last Post: 13 Oct 2009, 03:31 AM
  5. Replies: 4
    Last Post: 9 Jun 2009, 08:17 PM

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