Post by luke213 » Sat Jul 29, 2017 12:14 am

So guys I've been running OC for a while now, recently updated my site up to current 2.3.0.2 version(from memory) then yesterday noticed that the newest version included native square support so I went ahead and updated again. Of course that broke nearly everything;) But after working well into the early hours I got just about everything back up and running redid my themes to handle the new format for those etc.

What I could not seem to get running though is the mail function, or rather email notifications on new orders and "notify customer" on editing orders. I had it setup initially years ago running through SMTP, then a few versions later I had an issue, and switched over to the mail function sending through PHP. It was working fine until last night when I did the update, I verified that none of my settings have changed. They are the same as they were previously.

So I did some reading, I am hosted on 1and1. So I took a look at their SMTP settings and ran those which were about normal including the tsl:// prefix to their mail server. I also tried to send via gmail with the same results which was a timeout error when trying to submit the contact form. I also tried going back to "mail" rather than SMTP and I found the contact form is working and sending emails to me, however I can't seem to get customer notifications working, nor my email notifications of orders.

Any suggestions would be appreciated, I've tried everything I can find on here for possible solutions bar actually editing the files themselves to do any modifications. The main reason I avoided that was I wasn't sure how much was changed with v3 as far as this part of the code and didn't want to fiddle with something that is very likely different. But I'd appreciate some help, as it stands my site is functional enough, but that's a part of my process of notifying customers that is a real pain not to have functional.

Take care!

Luke

New member

Posts

Joined
Thu Jul 08, 2010 2:35 am


Post by nez762 » Sun Jul 30, 2017 10:36 am

This appears to be the exact same behavior I am getting. Same configuration as above. Any fix on this yet?

Newbie

Posts

Joined
Sun Jul 30, 2017 10:34 am

Post by luke213 » Sun Jul 30, 2017 10:58 am

I've got no fix yet. Hoping someone who's better with this than I will see this and have an idea;)

New member

Posts

Joined
Thu Jul 08, 2010 2:35 am


Post by nez762 » Sun Jul 30, 2017 10:53 pm

If anyone else has the email notifications working on v3.0.2, I would like to know. Thanks.

Newbie

Posts

Joined
Sun Jul 30, 2017 10:34 am

Post by blackdesign » Sun Jul 30, 2017 11:23 pm

I am interested in and agree with this.

Newbie

Posts

Joined
Sat Feb 21, 2015 11:22 pm

Post by luke213 » Mon Jul 31, 2017 10:47 pm

Well apparently I'm not alone at least with this issue, what host are you guys using that are having issues, perhaps it's some host related issue.

Currently my site is running on 1and1.com and while it's a PITA they typically work well enough for me despite some weird issues here and there. Post what you're using for a host if you're having trouble with the new versions email system maybe we can track down some sort of cause.

Luke

EDIT: Ok did a bunch more testing while I should have been working;) I had a thought of something I changed that could have been related, SSL. Previously I didn't take payments automatically on my site because well my business is weird IE 8-10 weeks between placing an order and being built. None the less I enabled SSL and I went through and enabled SEO on allot of my products as well. So I got to thinking and reading guys having issues with both related to emails somehow. So I went ahead and disabled both, edited my config's back to http rather than https and no change.

One thing I did change also was I tried virtually every combination of SMTP settings to get outgoing mail hoping it was a PHP mail issue rather than a system wide mail issue. I tried using gmail for the entire config, and got issues with time outs acting as though it wasn't able to communicate with their server or connect via SSL or TLS. Then I tried using 1and1's settings and got all the same issues until I finally tried using 25 rather than the secure ports and I now have the contact form working through 1and1 on SMTP rather than mail which is a first.

My guess at this point is something changed in the mail code, possibly breaking authentication of some sort for secure mail servers, or something related to SSL/TLS. Though it also could be some bit of remnant code causing the issue. I think what I'm going to do now is try and do another fresh install along side my existing store on my site for testing and see if I can't get email configured and working hopefully to eliminate 1and1 being the source of the issue and nail down that it's some sort of carry over from my upgrades etc. I will post though as I find anything that might be of help for others running into this issue.

New member

Posts

Joined
Thu Jul 08, 2010 2:35 am


Post by nez762 » Tue Aug 01, 2017 12:46 am

1and1 is my host. I've tried everything I could possibly find on this over the last three days. No luck at all.

Newbie

Posts

Joined
Sun Jul 30, 2017 10:34 am

Post by luke213 » Tue Aug 01, 2017 12:54 am

That's actually great news, at least we've got something in common. Currently installing the new blank test store, I'll see if I can get it working with none of my other stuff installed. I forgot to add please include whether you're trying to use mail or smtp and also if your store was a fresh new install or an upgrade and if upgrade from what version.

Luke

New member

Posts

Joined
Thu Jul 08, 2010 2:35 am


Post by luke213 » Tue Aug 01, 2017 1:18 am

OK Good news and bad news. I'm also sorry to keep bumping this up but I wanted to make sure that guys looking for solutions above will see this. So I did a test install along side my existing install absolutely minimal config just a live store without anything else installed completely fresh.

Initially running mail default config zero changes other than my store email address being listed on the store settings, nothing in the "mail" tab bar the default blank fields and 25 as the port and 5 as timeout. It worked, worked for the contact form as well as adding orders and customer notifications. So that is encouraging that 1and1 doesn't seem to be the issue directly I'm leaning towards an upgrade issue.

Then to further test I went ahead and installed the SMTP info for 1and1 the same way I have it in my real store exactly the same. And it works flawlessly. Both contact and all other forms of communication working with a test email address from the test site. I also for the sake of testing tried using the proper port rather than 25, 587 from memory. None the less with that setting on my real site it fails with a comm error, on the fresh install it fires right through and works flawlessly. I also went ahead and setup gmail with the proper settings which went perfectly as well.

SO at this point something is going on with my install, either something carried over from the previous install since my site has been around for over seven years now and has run allot of versions of OC this is a very upgraded install. Likely some file or bit from the past is binding me up now, which isn't a surprise this seems to happen each time I upgrade;) And if admins are seeing this not complaining just seems to be my luck that I run into oddball issues;)

So I'll continue to dig, but if it's easy for you to do I'd suggest trying the same thing setup a dummy store on your site in a new folder with a new database and see if your results mirror my own. If so then at least we know we're all on the same page.

If someone out there who is far better with code than I am sees something in this that I can try, or a place a can pull a log from since I've got zero errors when running through mail. But this might make sense to guys who are actually working in the PHP files related to sending mail. If so any help would very much be appreciated.

Take care!

Luke

EDIT: So I just finished another quick test, I went ahead and changed the test site to point to my primary sites database. So it won't load images, but it will load products and everything else like that, but using all the files from a fresh install basically. Works fine, though SEO irritates it since it points to the wrong URL. None the less I tested the contact form this way, and it works. Of course the SMTP setting is in the database so it works fine running that way however the interesting thing is that it won't send emails for order edits etc. So that leads me to believe this is something in the database, maybe a call that has changed or a field, I'm going to try and take a quick gander in there and see if I can't find anything that looks like it could be causing the issue. I really wish I knew more about this whole facet of site stuff but honestly I'm sort of grabbing at straws at this point.

EDIT2: Another update, so I imported my existing database into the new test database. The only real difference in organization is the new one contains the oc_ prefix where as my old version doesn't. As a result I edited the config file to remove the oc_ prefix which then allowed it to run. Then I tried sending an email via the notify customer section and no go. So there is something related to the database going on at least on mine. I have zero clue what so far I've spent the last few hours digging around and trying different things to see if I could stumble into the issue. I tried copying the table from the new database with the OC prefix in there into the good database on the hope that something somehow was directly looking for the entry with the prefix screwing up mine.

I think next step I will try is create another test store, new database, use no prefix in the installation. Then backup the fresh database after install, then import mine along with all my customers and data. Then test, if it works awesome, if not I'll overwrite the fresh database on top of my information hopefully correcting whatever entry has changed in the distribution but not in my database. We'll see if it works or not but I've gotta get this running one way or the other and I'd really rather not roll back all these hours of work updating the site to the newest version.

New member

Posts

Joined
Thu Jul 08, 2010 2:35 am


Post by nez762 » Tue Aug 01, 2017 5:27 am

Well I just nuked the entire website and did a new install of 3.0.2. I'm right back to the exact same spot I was 4 hours ago. The only thing I kept was the database, I didn't create a new one. Same email behavior as before. I can get the Contact Us form to send out an email, but no other notifications using the PHP Mail or the SMTP settings.

Newbie

Posts

Joined
Sun Jul 30, 2017 10:34 am

Post by luke213 » Tue Aug 01, 2017 5:50 am

That's pretty much confirming my same setup. I fell back from importing my database over the new install since apparently phpmysql will not create column on import or something to that effect. So after much fiddling I gave up. Though I did confirm prior to that the site would send and receive email.

I'm assuming your site is an upgrade as well, it seems there is something in our "updated" database causing the issues, I still don't know what though. I've looked over them. The only thing I notice that is different is the "oc_" prefix in mine, and I've got a couple additional fields in the address table which are "tax_id" and something else that must have been either included in an older version of OC or a module I had installed ages ago.

Either way I've also just got a call from a customer saying that he couldn't place an order because of a shipping issue, so I'm going to go try and replicate that before I get back to email notifications. Since this email thing is a PAIN but I can work around it, if guys can't place orders because the site is flaky that's costing me money.

Luke

New member

Posts

Joined
Thu Jul 08, 2010 2:35 am


Post by nez762 » Tue Aug 01, 2017 6:44 am

If you are configured to use PHP Mail. The contact form works fine and uses the mail.php file in system/library/mail. The forgot password email code is using something else.

Newbie

Posts

Joined
Sun Jul 30, 2017 10:34 am

Post by luke213 » Tue Aug 01, 2017 6:59 am

nez762 I'm with ya there, it seems the contact form is the only part that is working. It also works with SMTP when using the 1and1 settings with port 25 rather than the secure port.

If you get a sec check your PM's let's see if we can't get together and make some sense of what the heck is going on.

Luke

EDIT: Did a bunch more testing and still making circles. Tried the Beta 3.2.0.1 and didn't help at all. Fresh install it's working fine, replace the database with my good one with all my info in and mail function falls flat on it's face.

Nez I did notice that making the mail function fail with say using the wrong port setting will pull an error that actually logs, and doing so shows the same SMTP or MAIL file when notifying customers via the backend. I didn't test forgot password or any other functions but it looks like it's somewhere in the database that those two files are calling is the issue. But I'm beyond my expertise trying to figure out what is the root cause here. I'm still trying but I haven't stumbled on a fix yet.

EDIT2: So I found some posts and bug reports about the config_mail_alert_email and config_mail_alert that seem to indicate there was some mixing up of those two variables in the past versions so I've been working on figuring out if possibly one of them is calling the wrong variable maybe causing the mail to not show the "alert" function as enabled for orders. Wouldn't explain the notify customers unless they are related somehow in that file. Either way that's where I am, maybe it will spur someone else onto how to fix this.

New member

Posts

Joined
Thu Jul 08, 2010 2:35 am


Post by nez762 » Tue Aug 01, 2017 6:41 pm

Well good luck. I'm to the point of dumping opencart after all these years. Way too many bugs and poor support.

Newbie

Posts

Joined
Sun Jul 30, 2017 10:34 am

Post by luke213 » Tue Aug 01, 2017 11:04 pm

I've had allot of bugs, but typically I'm behind the curve enough to read up on the forums and find all the fixes etc. This is the first time I've found something, put this much time in and ended up basically right where I started. For the time being I'm working on going back to 2 and waiting for more support for this newer version. Unfortunately I jacked up my backup so I'm working on that now trying to get back to where I should be. Shouldn't be too bad either way but I'll likely go back until this gets patched up or fixed one way or the other.

Everytime I consider going to some other cart I find things I use constantly in OC and realize the grass probably isn't any greener on the other side, so very likely I'll stay here despite the time suck getting things running properly.

Luke

New member

Posts

Joined
Thu Jul 08, 2010 2:35 am


Post by luke213 » Sun Aug 06, 2017 5:47 am

Well I'm still working on this though a little slower than expected;)

So today I had a bit of an idea to test something. I went ahead and created a new folder and install with my existing database. Deleted all files other than images and config.php's and then copied and ran the install script for 2.3.0.2 and notifications etc are working flawlessly. Then I did the same delete all files other than images and config.php's again and copied and ran the install script for 3.0.2.0 and of course it then broke the entire email system again with the same settings;)

So this further confirms something in the database changed from 2.3.0.2 to 3.0.2.0 and my guess would be an upgrade between those versions seems to break the email system somehow. Does anyone have any ideas what things would have changed in the database between the two? Since when I did a fresh install with a new database I didn't have any issues so it sure seems like an upgrade issue rather than a new install issue. And it doesn't seem to be file related at all, since I've replaced virtually everything in tests and each time the site runs fine but the instant I tie to my current database with it's data it falls flat on it's face.

So any input would very be much appreciated since I can't seem to stumble onto the fix by myself thus far. Oh and that reminds me, something I saw that was a touch odd, but not sure it's not normal behavior. The API, with the upgrade to 2.3.0.2 I used to have to click "add IP" often to add my ip to the API. Now with version 3 there seems to be an automatic script basically adding the IP to the API table. But I noticed in sessions it seems to be generating two tokens per IP in that table. Got me thinking perhaps it's doubling those or something related to the way the API is now setup possibly causing issues. But this could be normal and I may not actually have any issues there I'm really not sure. Just something odd I noticed.

Luke

New member

Posts

Joined
Thu Jul 08, 2010 2:35 am


Post by luke213 » Sun Aug 06, 2017 8:10 am

Well I SOLVED THIS PROBLEM:)

So what it ended up being was the "event" section/table in the database. I never noticed it before today, I had finally merged a new and old database manually and pulled the info I needed and left everything else behind. Well afterwards I was patching up things that weren't enabled or needed to be fixed like taxes etc. Since I pulled only the necessary info for my customers, orders and products. Well as I was doing that I noticed the "event" section in the admin, and comparing to my existing installation I realized there were a bunch of notifications called from in there. So I exported that database from the working install pushed it into my primary database and low and behold it works like it should.

So the issue if anyone reading this is writing the code, is that you need to insert that section into the database on the upgrade along with the new entries or fix that since it certainly didn't work in my case if it's supposed to be done automatically. Now for those others with this issue here is the fix for you. Goto phpmyadmin or your php setup and backup first all of your current database just in case you break something. Then drop the "event" table, then import the attached file here(rename the file extension .sql rather than .txt) or copy the following code into a file called "eventpatch.sql"(or whatever you'd like to call it. Then import that into your database which will install the default calls included on a new installation magically fixing your email.

Like anything else I'm not responsible for what you do on your site, I'll try and help but I'm no pro when it comes to this stuff obviously since it took me the better part of a week to find this. But this should work for others in the same spot I was.

Luke

Code: Select all

-- phpMyAdmin SQL Dump
-- version 4.1.14.8
-- http://www.phpmyadmin.net
--
-- Host: db000000000.db.1and1.com
-- Generation Time: Aug 05, 2017 at 06:34 PM
-- Server version: 5.5.55-0+deb7u1-log
-- PHP Version: 5.4.45-0+deb7u9

SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";


/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;

--
-- Database: `db000000000`
--

-- --------------------------------------------------------

--
-- Table structure for table `event`
--

CREATE TABLE IF NOT EXISTS `event` (
  `event_id` int(11) NOT NULL AUTO_INCREMENT,
  `code` varchar(64) NOT NULL,
  `trigger` text NOT NULL,
  `action` text NOT NULL,
  `status` tinyint(1) NOT NULL,
  `sort_order` int(3) NOT NULL,
  PRIMARY KEY (`event_id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=34 ;

--
-- Dumping data for table `event`
--

INSERT INTO `event` (`event_id`, `code`, `trigger`, `action`, `status`, `sort_order`) VALUES
(1, 'activity_customer_add', 'catalog/model/account/customer/addCustomer/after', 'event/activity/addCustomer', 1, 0),
(2, 'activity_customer_edit', 'catalog/model/account/customer/editCustomer/after', 'event/activity/editCustomer', 1, 0),
(3, 'activity_customer_password', 'catalog/model/account/customer/editPassword/after', 'event/activity/editPassword', 1, 0),
(4, 'activity_customer_forgotten', 'catalog/model/account/customer/editCode/after', 'event/activity/forgotten', 1, 0),
(5, 'activity_transaction', 'catalog/model/account/customer/addTransaction/after', 'event/activity/addTransaction', 1, 0),
(6, 'activity_customer_login', 'catalog/model/account/customer/deleteLoginAttempts/after', 'event/activity/login', 1, 0),
(7, 'activity_address_add', 'catalog/model/account/address/addAddress/after', 'event/activity/addAddress', 1, 0),
(8, 'activity_address_edit', 'catalog/model/account/address/editAddress/after', 'event/activity/editAddress', 1, 0),
(9, 'activity_address_delete', 'catalog/model/account/address/deleteAddress/after', 'event/activity/deleteAddress', 1, 0),
(10, 'activity_affiliate_add', 'catalog/model/account/customer/addAffiliate/after', 'event/activity/addAffiliate', 1, 0),
(11, 'activity_affiliate_edit', 'catalog/model/account/customer/editAffiliate/after', 'event/activity/editAffiliate', 1, 0),
(12, 'activity_order_add', 'catalog/model/checkout/order/addOrderHistory/before', 'event/activity/addOrderHistory', 1, 0),
(13, 'activity_return_add', 'catalog/model/account/return/addReturn/after', 'event/activity/addReturn', 1, 0),
(14, 'mail_transaction', 'catalog/model/account/customer/addTransaction/after', 'mail/transaction', 1, 0),
(15, 'mail_forgotten', 'catalog/model/account/customer/editCode/after', 'mail/forgotten', 1, 0),
(16, 'mail_customer_add', 'catalog/model/account/customer/addCustomer/after', 'mail/register', 1, 0),
(17, 'mail_customer_alert', 'catalog/model/account/customer/addCustomer/after', 'mail/register/alert', 1, 0),
(18, 'mail_affiliate_add', 'catalog/model/account/customer/addAffiliate/after', 'mail/affiliate', 1, 0),
(19, 'mail_affiliate_alert', 'catalog/model/account/customer/addAffiliate/after', 'mail/affiliate/alert', 1, 0),
(20, 'mail_voucher', 'catalog/model/checkout/order/addOrderHistory/after', 'extension/total/voucher/send', 1, 0),
(21, 'mail_order_add', 'catalog/model/checkout/order/addOrderHistory/before', 'mail/order', 1, 0),
(22, 'mail_order_alert', 'catalog/model/checkout/order/addOrderHistory/before', 'mail/order/alert', 1, 0),
(23, 'statistics_review_add', 'catalog/model/catalog/review/addReview/after', 'event/statistics/addReview', 1, 0),
(24, 'statistics_return_add', 'catalog/model/account/return/addReturn/after', 'event/statistics/addReturn', 1, 0),
(25, 'statistics_order_history', 'catalog/model/checkout/order/addOrderHistory/after', 'event/statistics/addOrderHistory', 1, 0),
(26, 'admin_mail_affiliate_approve', 'admin/model/customer/customer_approval/approveAffiliate/after', 'mail/affiliate/approve', 1, 0),
(27, 'admin_mail_affiliate_deny', 'admin/model/customer/customer_approval/denyAffiliate/after', 'mail/affiliate/deny', 1, 0),
(28, 'admin_mail_customer_approve', 'admin/model/customer/customer_approval/approveCustomer/after', 'mail/customer/approve', 1, 0),
(29, 'admin_mail_customer_deny', 'admin/model/customer/customer_approval/denyCustomer/after', 'mail/customer/deny', 1, 0),
(30, 'admin_mail_reward', 'admin/model/customer/customer/addReward/after', 'mail/reward', 1, 0),
(31, 'admin_mail_transaction', 'admin/model/customer/customer/addTransaction/after', 'mail/transaction', 1, 0),
(32, 'admin_mail_return', 'admin/model/sale/return/addReturn/after', 'mail/return', 1, 0),
(33, 'admin_mail_forgotten', 'admin/model/user/user/editCode/after', 'mail/forgotten', 1, 0);

/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;

New member

Posts

Joined
Thu Jul 08, 2010 2:35 am


Post by artcore » Sun Aug 06, 2017 5:03 pm

Great job ;D
Good to keep in mind!

Attn: I no longer provide OpenCart extensions, nor future support - this includes forum posts.
Reason: OpenCart version 3+ ;D

Thanks!


User avatar
Active Member

Posts

Joined
Tue Jul 09, 2013 4:13 am
Location - The Netherlands

Post by luke213 » Mon Aug 07, 2017 1:11 am

Thanks;) I'm not sure how wide spread this will be with upgrades, I honestly don't have another database on hand that is working to test the upgrade on, nor do I have the time to keep fiddling now that it's working;) I already lost way too many hours this week to finding this issue and fixing it. But I suspect it's either on all upgraded stores(wish I'd have noticed that "event" section earlier), or it's something that was carried over of sorts with my ancient database.

So not sure the root cause but if guys are running into this problem on V3 check that Extensions>Events section in admin and if you've only got a couple things listed there this is likely the same problem. Of course you'll still have to insure that your mail settings under Settings are correct, but this is independent of that so to speak. You can like I did have all the server settings perfect and still not get mail to yourself or customers if the event section is not correct;)

Take care!

Luke

New member

Posts

Joined
Thu Jul 08, 2010 2:35 am


Post by artcore » Mon Aug 07, 2017 1:59 am

Very true! I experienced something similar with the theme event; without it, it wouldn't take a custom theme. But I won't be using 3.+ any time soon, no time to debug ;D

Attn: I no longer provide OpenCart extensions, nor future support - this includes forum posts.
Reason: OpenCart version 3+ ;D

Thanks!


User avatar
Active Member

Posts

Joined
Tue Jul 09, 2013 4:13 am
Location - The Netherlands
Who is online

Users browsing this forum: No registered users and 49 guests