Hello there,
We’re sorry for your inconvenience. Our plugin is not intended to send emails continuously, but it has the flexibility to keep informing subscribers about products that are back in stock. We shared the below code, which does the trick.
Please put the below code either in theme functions.php
or child theme functions.php
and check it out.
function cwg_instock_change_post_status($new, $old, $post) {
$post_type = $post->post_type;
if ('cwginstocknotifier' == $post_type) {
if ($new == 'cwg_mailsent' && $old == 'cwg_subscribed') {
$obj = new CWG_Instock_API();
$obj->subscriber_subscribed($post->ID);
}
}
}
add_action('transition_post_status', 'cwg_instock_change_post_status', 10, 3);
Let us know.
Thanks.