ID; } else { $domain_id = $domain; } $email_accounts[] = $email_id; $campaign_name = get_the_title($email_id); } else { $email_accounts = []; $domain_id = ''; $campaign_name = ''; } $campaign_data = [ 'campaign_name' => $campaign_name, 'domain_id' => $domain_id, 'email_accounts' => $email_accounts, 'num_additional_emails' => '', 'start_date' => date('Y-m-d', strtotime('today')), 'warmup_period' => 8, 'starting_volume' => 5, 'target_volume' => 200, 'weekend_reduction_factor' => 60, 'target_profession' => '', 'target_profession_other' => '', 'campaign_conversation_topics' => '' ]; if ($post_id > 0) { $post_item = get_post($post_id); if ($post_item && $post_item->post_type === 'campaign') { $campaign_data['campaign_name'] = $post_item->post_title; foreach ($campaign_data as $key => $value) { if ($key !== 'campaign_name') { switch ($key) { case 'domain_id': $domain_id = get_field('domain', $post_id) ? get_field('domain', $post_id) : ''; if ($domain_id) { $campaign_data[$key] = $domain_id->ID; } break; case 'email_accounts': $email_accounts = get_field($key, $post_id) ? get_field($key, $post_id) : ''; $campaign_data[$key] = $email_accounts; break; case 'start_date': $start_date = get_field($key, $post_id) ? get_field($key, $post_id) : ''; $campaign_data[$key] = date('Y-m-d', strtotime($start_date)); break; default: $campaign_data[$key] = get_field($key, $post_id); break; } } } } } // Get domains for current user $domains = get_posts([ 'orderby' => 'title', 'order' => 'ASC', 'post_type' => 'domain', 'posts_per_page' => -1, 'meta_query' => [ [ 'key' => 'owner_id', 'value' => $current_user_id ] ] ]); log_to_file("page-edit-campaign.php - Domains: ", $domains); // Get the list of default professions $professions = rl_get_textarea_meta_as_array('option', 'default_profession_pool'); // Enqueue Scripts wp_enqueue_script('campaign-form', '/wp-content/plugins/rl-mailwarmer/js/campaign-form.js', array('jquery'), '1.0', true); wp_localize_script('campaign-form', 'campaign_form_vars', array( 'ajax_url' => admin_url('admin-ajax.php'), 'nonce' => wp_create_nonce('campaign_form_nonce'), 'delete_nonce' => wp_create_nonce('campaign_delete_nonce'), 'campaigns_page' => site_url('/campaigns/'), )); get_header(); ?>
>
>
>
>

View Campaign
class=""> Disabled campaigns will not send any mail until they are re-enabled
% Reduce traffic on weekend & holidays by this percentage
class=""> This will delete any pending messages and recreate the timeline based on the above fields

Delete Campaign