Hi,
Thank you for your further information.
Please add these custom snippets into the function PHP file of your theme, after saving, go to our plugin > the Email Subscribe, take notice whether all emails of the existing customers have been synced in the list yet, if it’s done, then please delete the custom snippets. Once the emails of the existing customers are enlisted, our plugin will notify them that their email has been subscribed whenever they try to subscribe again via the coupon box popup.
add_action( 'admin_footer', function () {
$users = get_users( [] );
foreach ( $users as $user ) {
$email = $user->user_email;
$emails_args = array(
'post_type' => 'wcb',
'posts_per_page' => - 1,
'title' => $email,
);
$the_query = new WP_Query( $emails_args );
if ( $the_query->have_posts() ) {
continue;
}
$my_post = array(
'post_title' => $email,
'post_type' => 'wcb',
'post_status' => 'publish',
);
$post_id = wp_insert_post( $my_post );
echo '<pre>' . print_r( $post_id, true ) . '</pre>';
}
} );
Best regards.