I've programmed a cronjob in WordPress which get's executed every 5 minutes. In the function of the cronjob im trying to perform a do_action
:
error_log('Send Email');
do_action( 'trigger_new_subscription_notification_email', $dv_id, $new_order->id );
My problem is now that I can see the error_log in the debug.log of WordPress but there is no email sent. When I trigger the cronjob manually like in a cronmanager
, I receive the email.
I've also disabled wp_cron
and implemented a real cron call via a linux script.
So is it not possible to do a do_action
within WordPress cronjob?
I've programmed a cronjob in WordPress which get's executed every 5 minutes. In the function of the cronjob im trying to perform a do_action
:
error_log('Send Email');
do_action( 'trigger_new_subscription_notification_email', $dv_id, $new_order->id );
My problem is now that I can see the error_log in the debug.log of WordPress but there is no email sent. When I trigger the cronjob manually like in a cronmanager
, I receive the email.
I've also disabled wp_cron
and implemented a real cron call via a linux script.
So is it not possible to do a do_action
within WordPress cronjob?
You need to add this before calling do_action:
WC()->mailer();