Magento: Newsletters not going out - magento

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/#

Related

Magento 1.9.2.2 Order Confirmation Email Not Sent To Customers

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) {

Magento 1.9.1.0 Order Confirmation Emails - Not Sending

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.

Magento Admin Backend Blank Page after login

i have a serious problem in Magento Admin Backend. After login its shows a BLANK Page. i used the same files and database in different server, there it was working fine but when i have transferred files into LIVE then Admin issues came. Please help me over this as i got frustrated from last some dayz. If you need any more dertails then plz ask but i need to resolve this soon. Link: http://studywings.com/index.php/admin/
Magento ver: 1.7
flush your magento root /var/cache folder and /var/session folders, It may have previous server session that may cause problems.
Otherwise disable all third party modules and try again. I think this will help
I had the Same problem,
i have also debug the any errors occured, i tried index.php file
ini_set('display_errors', 1);
error_reporting(E_ALL);
$_SERVER['MAGE_IS_DEVELOPER_MODE'] = true;
pleced above code in index.php file. after that i have tried admin login.
showing the errors are session related, header already send errors.
i have to add the code in root/index.php file in top add the following line.
ob_start();
after that tried the login its worked.
Cheers..!
Is url changes to this after click login button or not?
http://yourdomain.com/index.php/admin/index/index/key/(key value)/
if url changes but not not show the dashboard page then go to
app/code/core/Mage/Core/Model/Session/Abstract/Varien.php
make copy of this file
Find the code for setting session cookie parameters these started on line 77
Comment out the final three lines and be sure to remove the comma after $this->getCookie()->getPath(). You should end up with this:
// set session cookie params
session_set_cookie_params(
$this->getCookie()->getLifetime(),
$this->getCookie()->getPath()
// $this->getCookie()->getDomain(),
// $this->getCookie()->isSecure(),
// $this->getCookie()->getHttponly()
also line 104 comment out :
//call_user_func_array('session_set_cookie_params', $cookieParams);
If there is no change in url after click login then try to uncomment display error and see error_log file of your server
I think this problem is due to file permissions. As you added files from one server to another, permissions might be get changed.. Try to give the permissions to all the files. Check this http://www.mage-shop.com/forum/threads/3-Magento-Admin-Backend-Blank-Page-Error
There are a number of things that can cause it, but it's most common after migrating to a new server, last time it happened to me it was an excessively low php memory_limit setting on the new server - the Admin part of the site uses a lot more resources per user than the frontend.
In general when having this issue:
Flush out your cache by emptying var/cache
Clear out sessions by emptying var/sessions
Check the magento error logs/reports for an error code in var\logs and var/reports
Turn on magento error logs in mysql if logging isn't already on! (look in core_config_data for WHERE path like 'dev/log/active'
Check if your php configuration is displaying errors
Check your apache/php error logs for more clues - memory errors will show up here for example
Try this solution
It sounds like you want to enable Developer mode. Add this to your .htaccess file:
SetEnv MAGE_IS_DEVELOPER_MODE "true"
You may also want to enable display errors in index.php:
ini_set('display_errors', 1);
The best way I have found to debug is with X-Debug in a local environment. You can also use log files to help debug in a production environment, if your unable to run X-Debug in the environment.
I've got a more detailed posting here:
http://www.molotovbliss.com/debugging-tips-and-tricks-with-magento-commerce
Consider also installing XDebug
Hope this helps you!
Just to complete the other answers....
I am upgrading a magento install, and got the same problem, in the end I had another folder inside of var/
magento/var/minifycache
Only worked after clear deleting the files inside of this folder.
I had the same problem after uninstalling an extension. I thought that clearing cache would be enough, and I did without success... later speaking with the technical team, they commented me that it did not work because I hace memcache installed, and needed to be done the cleaning via system - backend (that i coudl not see...)

Can not login Magento admin page after move to my localhost

I just move my Magento store to my localhost environment for testing use, I also using Git to maintain code, but after I move all the files to my local environment, I can't login my admin page, but I can still see my frontend pages, and the git, the database, seems works well.
When I type a wrong admin/password to my admin page, it still gives me "Invalid password".
But when I enter the right one, it just refresh the page and stay at the login page, nothing happens.
Does anyone has met this problem before? Has any ideas?
Thanks in advance!
Although this question is old, all the above answers did not work for me until I did one additional thing.
Follow the very helpful answers already posted (summary):
Change your base_url to http://127.0.0.1/ for secure and unsecure path.
delete files in var/session and var/cache
alter your Varien.php file accordingly - depending on your version of Magento.
And then:
Finally, use http://127.0.0.1/your/site/folder/name/index.php/admin
It was the lack of the index.php/admin ( instead of using http://127.0.0.1/site/admin ).
I hope this helps someone else.
Recently started using Magento for a project and came across this issue. I was left frustrated by the fact there are at least ten or more different workarounds suggested on the net and it took a bunch of trial and error to find one that did the job. Seemingly some workarounds work for some versions and not for others. No one explained why or how the problem occurs and the most popular solutions involve hacking the code base or using a different url, which shouldn't be necessary.
The cleanest solution I found for Community Edition 1.9.1.1 was editing two config values in the database:
update core_config_data set value = NULL where path = "web/cookie/cookie_path";
update core_config_data set value = 0 where path = "web/cookie/cookie_httponly";
The cookie path is actually NULL by default on a fresh installation but it must either be NULL or empty string.
The behavior arises because some browsers including Chrome have issues creating cookies with a localhost domain, this means that when Magento calls session_start() the session identifier cookie never gets created and as a result information can not be passed from page to page. The login procedure is actually successful but the next request doesn't know about it, hence why you get redirected back to the login screen. There are no errors because Magento doesn't account for this edge case as a possibility.
If you do not provide a domain value when creating a cookie on localhost then the browser has no problem with it. Unfortunately just setting web/cookie/cookie_path to NULL is insufficient, because Magento's configuration class resolves this as an empty string which is enough for a real domain to be set later in the code:
if (isset($cookieParams['domain'])) {
$cookieParams['domain'] = $cookie->getDomain();
}
This method eventually uses the current HTTP host to resolve a real domain for the cookie, and the browser therefore wants nothing to do with it. However if we disable web/cookie/cookie_httponly then Magento will not perform this additional step, $cookieParams['domain'] is unset and no domain gets passed as a session parameter, thus allowing the session cookie to be created and things to function as they should.
Note that any time you modify the database configuration you must delete the contents of /var/cache/ for the changes to be reflected.
If like me you don't want to have to comment out code, or even make configuration changes, then I created an extension which overrides the getDomain() method shown above and returns null if we are on localhost, this should be somewhat more future proof and result in no collateral damage.
http://www.mediafire.com/download/q39p4k95s5tlght/LocalCookie.zip
Try deleting the contents of the cache folder /var/cache. Clear your browser cookies and try. Also, if you have copied down the database from your server, you may need to manually change the base urls (secure and non secure) as well as the cookie domain in the core_config_data table. Do this manually if you need to. e.g. web/unsecure/base_url with production value of http://www.mywebsite.com/ becomes "http://localhost/"
When ever I have had this it's because of this or cache. Ensure the cache folder is ignored in git hub if it's not already.
1.you need remove the cache
rm -rf var/cache/* var/session/*
2.change the domain form core_config_data
update core_config_data set value="http://127.0.0.1/" where path="web/unsecure/base_url";
update core_config_data set value="http://127.0.0.1/" where path="web/secure/base_url";
do these steps :
1: go through: xampp\htdocs\magento\app\code\core\Mage\Core\Model\Session\Abstract**
2: open **Varien.php file
3: make comment line number from 87 to 104 save it and try to login...
Had the same issue, but the fix was changing DB values:
UPDATE `core_config_data` SET `value` = 'http://127.0.0.1/example/' WHERE `path` = 'web/unsecure/base_url';
UPDATE `core_config_data` SET `value` = 'http://127.0.0.1/example/' WHERE `path` = 'web/secure/base_url';
Then in browser http://127.0.0.1/example/admin
Same problem! I fix my problem after remove/replace static domain in core_config_data Table
web/secure/base_url
web/secure/base_link_url
web/secure/base_skin_url
web/secure/base_media_url
For me, running it on IIS (I know, not officially supported):
Although other suggestions kind of worked I found the best solution was to enter a new A record for me domain like
127.0.0.1 local.example.com
Then in IIS add the binding
local.example.com
to my site and it worked perfectly.
I found there were errors when actually trying to login to the customer account more than admin but believe it still applies.

scheduled http call on AWS elastic beanstalk

I've been searching for a while and think I have part of the information I need but just need some assistance putting it all together.
What I'm trying to achieve is to call a URL (a codeigniter controller) on a regular basis e.g. every 5 minutes which will go through my database mail queue and send the mail using amazon SES.
So far I have successfully created the controller, model, DB and SES is working just fine. The controller sends 10 emails at a time and it all works fine when I manually hit the URL.
I'm not too familiar with cron jobs, but think this is where I need to head.
My application is set up on Elastic beanstalk on AWS.
I think that I need a folder called .ebextensions in my web root, with a file called something.config in it, where I can put some 'container commands'. I also think I will need to include 'leader_only: true' in there somewhere to avoid my replicated instances doing the same jobs.
When I don't understand is what should my container command be, considering controller is 'http://myapplication/process_mail' ? From examples I've seen I couldn't see how it determines the frequency, or even the code that 'calls' the URL.
In my controller, I previously had the following code to ensure it could only be called from the command line. Is this something I can keep and have or will the container command just hit the URL like any other user?
if (!$this->input->is_cli_request()) {
echo "Access Denied";
return;
}
Thanks in advance for any help at all. I think i just need help with what should go in the config file, but then again I may have gone down completely the wrong path altogether!
UPDATE:
So far I've got as far as this:
I believe i need to run the application from the commandline like this http://ellislab.com/codeigniter/user-guide/general/cli.html
so my command would be php index.php process_mail
So what I actually need is help with running this command evey 5 minutes. This is what I have so far:
container_commands:
send_mail:
command: php index.php process_mail
leader_only: true
But what I don't understand is how I get this to run every 5 minutes, rather than just when the instance is set up. Do I need to create a cron job file on instance creation, with the php command in it instead?
Update 2:
To anyone else with the same problem, i got this sorted in the end like this:
an ebextensions file that looks like this: (.ebextensions/mail_queue.config)
container_commands:
01_send_mail:
command: "cat .ebextensions/process_mail.txt > /etc/cron.d/process_mail && chmod 644 /etc/cron.d/process_mail"
leader_only: true
a file called process_mail.txt in the same folder that looks like this:
# The newline at the end of this file is extremely important. Cron won't run without it.
*/5 * * * * root /usr/bin/php /var/app/current/index.php process_mail > /dev/null
So, every 5 minutes it runs via the cmd line the codeigniter main index file, passing in the controller name.
thanks to this: https://stackoverflow.com/a/15233848/2604392
I would set up the cron job to talk to the url, then store result in a MySQL database. Then regular PHP or any other app can connect to MySQL and access the data. That's the suggested way to connect to Twitter since a few months, so you can find info on how to do this floowing search for Twitter connectivity.
Hope this helps
By the way, while writing an email generating PHP script, I noticed that I have to slow down the pace of email sending to avoid being flagged as spammer. I added a delay of 2 seconds between emails and it did the job. My database was only 2500 so no big deal (except taking care of changing the PHP_MAXEXECUTION time variable)...

Resources