I've recently upgraded to Magento CE 1.9.1.0 and our order confirmation emails are not being sent to customers or the employees here that are setup to receive notifications.
I checked the Email Logs and don't see the emails hitting the server at all.
Emails come through from the Contact Form, New User Account Signup and a few test scripts I created on the server. I made sure that Disable Email Communications was set to "No".
Any ideas? They worked great in 1.7.0.2 before we upgraded.
Starting from Magento 1.9 the order confirmation emails are not sent during checkout anymore, instead they are sent with the Cron. To verify this works properly:
make sure your system Cron is up and running (you can check the Cron logs: /var/log/cron to verify that).
make sure Magento Cron is setup correctly and is running every some minutes. You should see something like this in the Crontab of your system:
*/5 * * * * /public_html/cron.sh
This schedules a task to run cron.sh every five minute. (More reading)
There are good extensions like AOE Scheduler in Magento that help you to monitor and manage Cron jobs.
An alternative way to this is to disable the Cron for these kind of emails (order confirmation). To do this you can go to this path:
public_html/app/code/core/Mage/Sales/Model/Order.php
Copy that file and bring it to this path (if the path doesn't exist create it):
public_html/app/code/local/Mage/Sales/Model/Order.php
And then change this line:
$mailer->setQueue($emailQueue)->send();
To:
$mailer->send();
However I recommend spending some time to setup the Cron instead. I think if they wanted to use Cron for these emails it's for a reason.
Just do a small change in order.php (public_html/app/code/core/Mage/Sales/Model/Order.php)
From
$mailer->setQueue($emailQueue)->send();
To
$mailer->send();
Solution is simple that i found.
go to System -> Configuration -> ASCHRODER EXTENSIONS -> SMTP -> Queue Configuration -> Queue Usage -> Never
Done!
Order Confirmation will be sent quickly. :)
Quick solution is:
Go to the following location: /app/code/core/Mage/Core/Model/Email/Template.php
Change Line 407
if ($this->hasQueue() && $this->getQueue() instanceof Mage_Core_Model_Email_Queue) {
To:
if (!($this->hasQueue() && $this->getQueue() instanceof Mage_Core_Model_Email_Queue)) {
It will work.
Thanks Pankaj
Please ovewrite 'app/code/core/Mage/Sales/Model/Order.php' file.if you dont want to any changes in xml file so So just copy /app/code/core/Mage/Sales/Model/Order.php into /app/code/local/Mage/Sales/Model/Order.php and be sure to refresh the cache. and change
$mailer->setQueue($emailQueue)->send();
To
$mailer->send();
Goto /app/code/core/Mage/Core/Model/Email/Template.php
Below changes :
if ($this->hasQueue() && $this->getQueue() instanceof Mage_Core_Model_Email_Queue) {
To
if (false){
I had exactly the same problem. For me it was a local copy of the order.php that I had made some changes to in the past and that I had copied to \app\code\local\Mage\Sales\Model\Order.php.
Thus, the updated order.php of Magento 1.9.1.0 in the core directory was not in usage - causing the order confirmation emails not to be send automatically via the cron job.
I keep the fingers crossed that you suffer from the same issue.
Just add cron in cpanel or plesk panel. It will available on cpanel -> Advanced and click cron folder. Then proceed:
*/5 in the 'minute' field (may customize this)
* in the 'hour' field
* in the 'day' field
* in the 'month' field
* in the 'weekday' field
comment: http://www.yoursite.com/absolute/path/to/magento/cron.php
There are many answers but none worked for me. How i solved is that,
check that if your default template setup are there in the magento or not. Sometimes during installation its lost and actually "there is no email template by default in system to send your email". Please go to Admin side, System->Transactional Email-> by default you will find no template here. So add one by clicking on button 'Add new Email template. In Load default template panel select a template from the Template drop down suppose forgot Password and click and click Load Template. As earlier said no email template is associated with it so it will not be show in below. The bset thing is to go to install a fresh copy of magento in your local system navigate here and put that same content here and click Save Template button.
Then go to System->Configuration->Customer Configuration ->Password Options->Change the 'Forgot Email Template' dropdown to yours as added above .Happy . thus same thing you can also do for order ,shipment, new account etc.
To debug magento order mail issue regarding new order just run yoursite.com/cron.php
If you recieve any mail now then its cron issue.
You can fix con issue by setting cron in cpanel.
Related
I have done virtually everything but this problem persists. Upon creating an order, the customer does not receive a confirmation email. The problem started some 6 months ago and it was On and Off until a month ago when it ceased sending completely. Please does anyone have any idea how I can fix this? Thanks.
NB: The cron is set correctly and is working properly.
In Magento 1.9.1 and above versions, the emails are not being sent directly during checkout but instead are being queued. The queue is being processed via your Magento cron jobs. Please ensure your cron jobs has been set up and is running correctly.
Ist check your cron if cron is running mail is definetly send other wise 1 more option you can take just do small change in core file-
Template.php is located in => /app/code/core/Mage/Core/Model/Email/Template.php
if ($this->hasQueue() && $this->getQueue() instanceof Mage_Core_Model_Email_Queue) {
use
if (!$this->hasQueue() && $this->getQueue() instanceof Mage_Core_Model_Email_Queue) {
I have a problem when it comes to registration as in confirmation was not sent to my email. Aside from this, it keeps returning to the registration page, no progress at all. What shall I do?
Anyway I'm using Joomla 3.6.2 with VM 3.0.18 installed
To start at somewhere:
1. Make sure that mailer is configured under Global Configuration \ server \ Mail Settings.
2. See if mails are sent locally. Webservers like Open server or Denwer have an option to get your emails locally, dumped to some folder as files.
3. Also see if options for Virtuemart registering are okay.
I have an installation of Magento 1.9.2. I am using a custom theme, and anytime I try and place an order it kicks off the Ajax on the page and then stops with no error messages, but does leave a log:
ERR (3): User Error: Some transactions have not been committed or rolled back in /html/lib/Varien/Db/Adapter/Pdo/Mysql.php on line 4039
I have spent 2 days trying to get to the bottom of this with no joy. It doesn't matter what payment method I use its always the same.
You should try to log all MySQL queries to see what wrong here. lib/Varien/Db/Adapter/Pdo/Mysql.
Open the file lib/Varien/Db/Adapter/Pdo/Mysql.php and change the value of the protected property $_debug to true. You can also change the value of $_logQueryTime which is especially handy when debugging slowdowns. Once you make this change all queries will be logged in the file var/debug/pdo_mysql.log
Hope this will help you. Please put your corrupted query here if you fixed it.
I had today the same problem. Magento 1.9.2.4 with a custom theme. Everything worked fine, expect the checkout-process. The custom theme used the PHP short open tag <? php code ?> . After enabling short_open_tag in the php.ini, everything works fine.
My magento application use to change automatically the flag new arrival in all products as soon as they reach 2 weeks in the system. And now it is not happening anymore. The flag is located on Catalog > Manage Products > Tab Custom.
Could someone tell me where exactly in the code Magento sets this flag as true/false, please. And then I can investigate what is going on.
Thanks in advance.
As Bhavik Shah points out, it is likely the cron job is failing to run - try trigger the cron manually by hitting: http://yourstoreaddress.com/cron.php
Second step would be editing your cron.php in your store root to the below then turn on logging in System > Configuration > Developer > Log Settings:
Mage::app('admin')->setUseSessionInUrl(false);
try {
Mage::getConfig()->init()->loadEventObservers('crontab');
Mage::app()->addEventArea('crontab');
Mage::dispatchEvent('default');
Mage::log("Cron run"); //Add this line and you will get a log entry
} catch (Exception $e) {
Mage::printException($e);
}
This will tell you if the cron job was run and when in /var/log/system.log
Obviously check your PHP and server logs for any errors - also check the exceptions log under /var/log/exception.log
All this will hopefully help you in finding the root cause of the problem.
The problem i have is that i have created newsletter template, added few subscribers and i can add the template with subscribers into queue - all that works fine.
I can also run the cron.php from the browser - it runs without errors, but the damn e-mails are not going out anyway. For that reason i have not done the crontab -e and added the stuff into that file yet. As far as i see - it does not matter where you execute the file from - be it crontab, shell or browser - it should work in any case. And i can see that it is not working.
Any ideas?
Alan
May I suggest you take a look at the cron_schedule table of your database ?
As soon as the cron.php file has been called (should it be via crontab or via a browser request), there must be a line added to the table. The line is "newsletter_send_all".
If a previous "neswsletter_send_all" was scheduled it should be run and its status set to "success" and the new one to "pending". Or, if there's a problem, the warning message is stored in the cron_schedule table on the same line as the newsletter_send_all that failed.
If when running cron.php the cron_schedule table is not appended with a new line, there may be a problem with the config.xml file of the Newsletter module or with your cron settings in the admin configuration. About that last subject see : http://www.jnorton.co.uk/blog/setting-magento-cron-system
All the above may give you a few tracks.
Are any emails being sent from Magento? (such as order confirmations)? If not, you might need to setup your email sending options or the outgoing email settings on the server.
Navigate to Configuration>Admin>Security, select “No” in “Add Secret Key to URLs”, save configuration.
Src: http://www.magentocommerce.com/boards/viewthread/2424/P105/#