0

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?

1 Answer 1

-1

You need to add this before calling do_action:

WC()->mailer();
1
  • That will work only for WooCommerce... Jan 31, 2019 at 21:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.