array( array( 'key' => $acf_newsletter_receive['name'], 'value' => $acf_newsletter_receive['true'], 'compare' => 'LIKE', ), ), 'fields' => array( 'user_email', ), ); $users = get_users($args); /* * transform the array of associatives arrays into an array of string : * [['user_email' => ], ['user_email' => ]] -> [, ] * */ $users_string = array_map(function($arr) { return reset($arr); }, $users); return $users_string; } function get_all_partners_posts() { Plgntls::debug_infos(); } function extract_ending_offers($all_posts) { Plgntls::debug_infos(); } function extract_new_offers($all_posts) { Plgntls::debug_infos(); } function extract_new_partners($all_posts) { Plgntls::debug_infos(); } function extract_partners_if_less_than($all_posts, $total_count, $number) { Plgntls::debug_infos(); } function compose_newsletter_body_CIPF() { Plgntls::debug_infos(); $all_posts = get_all_partners_posts(); $ending_offers = extract_ending_offers($all_posts); // [ => , => ] $new_offers = extract_new_offers($all_posts); // [ => , => ] $new_partners = extract_new_partners($all_posts); // [, ] $total = count($ending_offers) + count($new_offers) + count($new_partners); $remaining_partners = extract_partners_if_less_than($all_posts, $total, 5); // [, ] ob_start(); ?>

newsletter cipf

$offer_number) { ?> $offer_number) { ?> id; // $old_body = $message->body; ////error_log("user_id: " . json_encode($user_id)); ////error_log("old_body: " . json_encode($old_body)); // // $pattern = '/\~\~(.*?)\~\~/'; // // $new_body = preg_replace_callback($pattern, 'newsletter_add_content_CIPF', $old_body); // $message->body = $new_body; // // return $message; //} //add_filter("newsletter_message", "newsletter_filter_content_CIPF", 10, 3); // // //function newsletter_add_content_CIPF($matches) { // Plgntls::debug_infos(); // error_log("matches: " . json_encode($matches)); // // $action = $matches[1].'_CIPF'; // // return $action(); //} // //function nouveau_partenaire_CIPF() { // Plgntls::debug_infos(); // error_log("nouveau partenaire"); // return "new partner"; //} // //function nouvelle_offre_CIPF() { // Plgntls::debug_infos(); // error_log("nouvelle offre"); // return "offre nouvelle"; //} // //function fin_offre_CIPF() { // Plgntls::debug_infos(); // error_log("fin offre"); // return "end offer"; //} ?>