Results 1 to 10 of 10
  1. #1
    Join Date
    Mar 2009
    Posts
    19
    Plugin Contributions
    0

    Default Order Confirmation Email Failing (sometimes!)

    Hello,
    I recently took a Zen Cart store live (after quite a bit of testing and customizing!). It seems to be going pretty nicely overall :)

    However, I have noticed something strange tonight after receiving an order and payment from a 'real' customer (as opposed to a test customer!).

    Basically they were not sent an order confirmation email (and I never received a copy either). I went and checked in the email_archive table in MySQL (as I have archiving enabled) and there is no record of the email being sent there either (but there is a record for all other test orders).

    There doesn't seem to be anything obviously wrong with the order as I went and had a look and it has a green check for "customer notified" Status: Processing. All the PayPal transaction details are there, Payer Id, Trans Id etc.

    I'm using the PayPal IPN Module, and didn't have any troubles with it during testing, both on their test site and also using their live site with some test transactions.

    They are 95% sure that they allowed PayPal to redirect them back to my site after payment was complete as well (I thought I'd ask while trying to find possible causes).

    As a test, I just went to the order, added a comment and when I updated it, they received an email then no problems.

    Any suggestions on what might cause the email not to be generated and sent, given all the PayPal details seem to be on the order (PayPal also sent me an email confirming the transaction)? It's strange though the order says the email was sent but the email_archive table shows no record. The only difference I can see with their order compared to other test ones was that they didn't enter any comments/instructions..

    I'll keep monitoring for further failures and patterns..

    Thanks for any ideas!

    LowlyWorm

  2. #2
    Join Date
    Mar 2009
    Posts
    19
    Plugin Contributions
    0

    Default Re: Order Confirmation Email Failing (sometimes!)

    Oh, also, is there an easy way to have Zen Cart regenerate the order confirmation email and send it out? I have read in some other posts about some email modules that allow you to resend messages, however as this one never even made it to the email_archive table, that might not help..

    Thanks!

  3. #3
    Join Date
    Mar 2009
    Posts
    19
    Plugin Contributions
    0

    Default Re: Order Confirmation Email Failing (sometimes!)

    Small update. I've been experimenting with placing orders. It seems now that all PayPal payments are not generating the order confirmation email (nothing in email_archive either), even though PayPal returns me to my site and also updates the order with the PayPal information correctly. The fact the order is being updated with the PayPal details suggests PayPal can access the URL I provided no problems.

    If I pick to pay by check/money order and submit the order, the confirmation email comes through no problems..

    Hmm If I knew the best place to in the code to set a break point, I could enable debugging on my server and step through the code to see what is failing.

    Is it when PayPal returns to your site by redirecting to

    /index.php?main_page=checkout_process

    or when the instant payment notification comes in via PayPal calling

    ipn_main_handler.php

    That the notification email is generated?

    Thanks

  4. #4
    Join Date
    Mar 2009
    Posts
    19
    Plugin Contributions
    0

    Default Re: Order Confirmation Email Failing - It's working again!

    More things I've tried:

    * Uninstalled and reinstalled the PayPal module - no luck

    * Restarted Apache - no luck

    * Turned on debugging (with the email option) in the PayPal module, received lots of emails and strangely, it produced two orders in the database instead of 1, and so took the stock of the item from 1 to -1! One confirmation email was sent (I think for the second order it produced. Turning off debugging results in no emails being sent again.

    * Rebooted the entire server machine that the website runs on - It works!! What the heck?! Hmm it's a clean install of ubuntu 9.04 and it had only been online for 24 hours since the last reboot.. I am going to keep a close eye on this problem and see if it reappears..........!!

    If anyone is familiar with the PayPal module, and wants to see the debug messages, just let me know and I'll email them :)

  5. #5
    Join Date
    Mar 2009
    Posts
    19
    Plugin Contributions
    0

    Default Re: Order Confirmation Email Failing (sometimes!)

    So the first order just came in from a customer since I last posted and once again, it's started to fail sending order confirmation emails again *sigh*

  6. #6
    Join Date
    Mar 2009
    Posts
    19
    Plugin Contributions
    0

    Default Re: Order Confirmation Email Failing (sometimes!)

    After more hunting, I found some other posts with similar problems. One suggested installing the Debug Utility from the add ons section, which I've done and I've now got a log of where the error is happening :-) I'll post the results tomorrow after I've had some sleep!

  7. #7
    Join Date
    Jan 2004
    Posts
    66,444
    Plugin Contributions
    279

    Default Re: Order Confirmation Email Failing (sometimes!)

    Troubleshooting PayPal IPN issues: http://www.zen-cart.com/wiki/index.php/PayPal

    You have to fix whatever's preventing your server from receiving PayPal's notices if you want it to work properly.

    Or, use Express Checkout instead.
    .

    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.

  8. #8
    Join Date
    Mar 2009
    Posts
    19
    Plugin Contributions
    0

    Default Solved!

    Hi DrByte,
    Thanks for the response :)

    It may have been lost in the all my posts last night, but the PayPal notifications were actually being received and orders were being updated correctly with PayPal information, this was not the problem and everything in relation to this was configured correctly. Something was failing during the generation of the notification emails and so they weren't being sent or saved to the database. The communications between my site and PayPal were fine.

    After installing the debug utility to dump out exceptions/errors to file, it was very easy to locate the problem and fix it.

    The problem was on line 927 in order.php

    I was eager to open it up and see what was on that line! Oh the suspense!

    I had installed a couple of extra modules, one of them was for extra customer fields. I had read the warnings that there was some weirdness with it, so installed it on my test site first. I then spent a while going through most of what it had changed checking and adding the necessary code to allow it to work correctly in places that needed the extra fields. However the module had also added a line into order.php which I had missed.

    $_SESSION['customersFields']->send_order_email();

    During my testing it seems that the sequence of orders I'd placed had resulted in the 'customersFields' being valid at this point, but in some situations with PayPal, the reference is invalid and so the member function call was quietly failing before the emails were being sent.

    This function is basically adding in some extra fields to be sent with the email as far as I can see, which I don't need and don't have the time to debug at the moment, so have just commented out the line solving all the problems. Yay!

  9. #9
    Join Date
    Jan 2004
    Posts
    66,444
    Plugin Contributions
    279

    Default Re: Solved!

    Yes, addons are the other culprit that could break normal operations.
    Glad you got it sorted out.
    .

    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.

  10. #10
    Join Date
    Apr 2008
    Location
    Chehalis, Washington, United States
    Posts
    32
    Plugin Contributions
    0

    red flag Re: Order Confirmation Email Failing (sometimes!)

    ver 1.3.8a patch1

    Order confirmation emails aren't working - they WERE working and I didn't change anything but now for some reason they stopped working.

    I went through this exercise before with my hosting provider and they were nice enough to help me with this - and we determined that the only thing that would work was smtpauth and the IP address (instead of the mail server name.)

    I have exactly the same settings in Outlook to send email from my website email address which work fine, but for some reason ZEN isn't sending the emails and I have lost two orders as a result. I have to get this fixed and soon.

    The strange thing is I didn't change anything - so I assumed it was the hosting company. They tell me nothing on their end has changed... so what could it be?

    I added the security patch but the email confirmation wasn't working before that (not just email confirmation but sending ANY emails from ZEN is a problem.)

    There are no errors reported when sending email. It seems as far as ZEN is concerned, the emails are sending properly. Is there an email archive (I have "archive emails" set to yes in the admin) I can look at?

    IDEAS??

    Thanks in advance.

    Jeff
    www.jeffreydesign.com

 

 

Similar Threads

  1. v150 2CO - Sometimes New Order Confirmation Emails are not being sent out
    By Nyasha in forum Addon Payment Modules
    Replies: 7
    Last Post: 27 Sep 2013, 01:47 AM
  2. Client sometimes doesn't receive order confirmation email
    By BiillO in forum General Questions
    Replies: 8
    Last Post: 4 Dec 2010, 05:26 PM
  3. I get paypal emails about payments received, but sometimes not the order confirmation
    By Customht in forum Built-in Shipping and Payment Modules
    Replies: 1
    Last Post: 20 Aug 2009, 12:20 PM
  4. Order Confirmation email usually works but sometimes not?
    By RocketFoot in forum General Questions
    Replies: 0
    Last Post: 10 Aug 2009, 06:38 PM
  5. Gift Certificate only orders failing on order confirmation
    By ficiousjigs.com in forum Discounts/Coupons, Gift Certificates, Newsletters, Ads
    Replies: 13
    Last Post: 11 Jun 2008, 09:00 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