Updated to use correct scrubber pool
This commit is contained in:
parent
e251e7fe24
commit
2c104022df
3 changed files with 27 additions and 2 deletions
|
|
@ -353,7 +353,7 @@ class RL_MailWarmer_Conversation_Handler {
|
|||
|
||||
// Fetch scrubber pool if 'received_by' is not passed
|
||||
if (!isset($args['received_by'])) {
|
||||
$scrubber_pool_full = self::get_email_accounts_for_pool($campaign_id, 'scrubber_test');
|
||||
$scrubber_pool_full = self::get_email_accounts_for_pool($campaign_id, 'scrubber');
|
||||
|
||||
// Pick $num_particpants random addresses
|
||||
$num_scrubbers = min($num_particpants, count($scrubber_pool_full));
|
||||
|
|
|
|||
|
|
@ -81,7 +81,7 @@ class RL_MailWarmer_Scheduler {
|
|||
*/
|
||||
public static function cron_process_pending_messages() {
|
||||
action_log("====================== Running Cron to process messages ========================");
|
||||
RL_MailWarmer_Message_Handler::process_pending_messages();
|
||||
// RL_MailWarmer_Message_Handler::process_pending_messages();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -371,6 +371,8 @@ add_action('wp_ajax_rl_mailwarmer_save_campaign', function () {
|
|||
$post_id = isset($_POST['post_id']) ? intval($_POST['post_id']) : 0;
|
||||
$new_post = ($post_id == 0);
|
||||
$calculate_timeline = isset($_POST['calculate_timeline']) ? true : false;
|
||||
$target_profession = false;
|
||||
$target_profession_other = false;
|
||||
|
||||
// Prepare post data
|
||||
$post_data = array(
|
||||
|
|
@ -440,6 +442,15 @@ add_action('wp_ajax_rl_mailwarmer_save_campaign', function () {
|
|||
return;
|
||||
}
|
||||
break;
|
||||
|
||||
case 'target_profession':
|
||||
$target_profession = $_POST[$field];
|
||||
break;
|
||||
|
||||
case 'target_profession_other':
|
||||
$target_profession_other = $_POST[$field];
|
||||
break;
|
||||
|
||||
|
||||
default:
|
||||
update_field($field, sanitize_text_field($_POST[$field]), $post_id);
|
||||
|
|
@ -447,6 +458,20 @@ add_action('wp_ajax_rl_mailwarmer_save_campaign', function () {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($target_profession_other) {
|
||||
$target_profession = $target_profession_other;
|
||||
}
|
||||
|
||||
// If no target profession is set, choose one from the default profession pool.
|
||||
if ( ! $target_profession ) {
|
||||
$professions = rl_get_textarea_meta_as_array('option', 'default_profession_pool');
|
||||
if ( ! empty($professions) ) {
|
||||
// Assign a random profession from the list
|
||||
$target_profession = $professions[array_rand($professions)];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Set campaign owner
|
||||
update_post_meta($post_id, 'owner_id', $current_user_id);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue