Reputation: 31
I trying to develop a plugin to send emails to users in a specific time, so I have created my plugin like that :
add_action( 'my_hourly_event', 'sendEmail' );
public static function activate() {
wp_schedule_event( time(), 'hourly', 'my_hourly_event' );
} // end activate
public static function deactivate() {
wp_clear_scheduled_hook('my_hourly_event');
} // end activate
function sendEmail() {
wp_mail( $email, $subject, $message );
}
Then I add this to wp-config.php :
define('DISABLE_WP_CRON', true)
;
Finally I add my cron in my site :
* /15 * * * wget -q -O - http://yourdomain.com/wp-cron.php?doing_wp_cron
But I didn't get anything, so please if someone has any idea I will be very appreciative.
Upvotes: 1
Views: 70
Reputation: 2045
If you add :
define('DISABLE_WP_CRON', true)
To wp-config.php
, it's normal that your CRON is not gonna be executed; try removing this line or replacing it by :
define('DISABLE_WP_CRON', false)
Upvotes: 2