diff --git a/CRM/Contact/BAO/Query.php b/CRM/Contact/BAO/Query.php
index 027d8165dfdf..ccbbafb72383 100644
--- a/CRM/Contact/BAO/Query.php
+++ b/CRM/Contact/BAO/Query.php
@@ -1635,8 +1635,9 @@ public static function convertFormValues(&$formValues, $wildcard = 0, $useEquals
}
}
elseif ($id == 'email_on_hold') {
- if ($formValues['email_on_hold']['on_hold']) {
- $params[] = array('on_hold', '=', $formValues['email_on_hold']['on_hold'], 0, 0);
+ if ($onHoldValue = CRM_Utils_Array::value('email_on_hold', $formValues)) {
+ $onHoldValue = (array) $onHoldValue;
+ $params[] = array('on_hold', 'IN', $onHoldValue, 0, 0);
}
}
elseif (substr($id, 0, 7) == 'custom_'
diff --git a/CRM/Contact/Form/Search/Criteria.php b/CRM/Contact/Form/Search/Criteria.php
index 845ab7c9a541..012500df3a47 100644
--- a/CRM/Contact/Form/Search/Criteria.php
+++ b/CRM/Contact/Form/Search/Criteria.php
@@ -231,9 +231,13 @@ public static function basic(&$form) {
$form->addRadio('privacy_toggle', ts('Privacy Options'), $options, array('allowClear' => FALSE));
// preferred communication method
-
- $onHold[] = $form->createElement('advcheckbox', 'on_hold', NULL, '');
- $form->addGroup($onHold, 'email_on_hold', ts('Email On Hold'));
+ if (Civi::settings()->get('civimail_multiple_bulk_emails')) {
+ $form->addSelect('email_on_hold',
+ array('entity' => 'email', 'multiple' => 'multiple', 'label' => ts('Email On Hold'), 'options' => CRM_Core_PseudoConstant::emailOnHoldOptions()));
+ }
+ else {
+ $form->add('advcheckbox', 'email_on_hold', ts('Email On Hold'));
+ }
$form->addSelect('preferred_communication_method',
array('entity' => 'contact', 'multiple' => 'multiple', 'label' => ts('Preferred Communication Method'), 'option_url' => NULL, 'placeholder' => ts('- any -')));
diff --git a/templates/CRM/Contact/Form/Search/Criteria/Fields/preferred_communication_method.tpl b/templates/CRM/Contact/Form/Search/Criteria/Fields/preferred_communication_method.tpl
index 3e94b37b2d42..3edd73cb3b22 100644
--- a/templates/CRM/Contact/Form/Search/Criteria/Fields/preferred_communication_method.tpl
+++ b/templates/CRM/Contact/Form/Search/Criteria/Fields/preferred_communication_method.tpl
@@ -3,7 +3,13 @@
{$form.preferred_communication_method.html}
-{if $form.email_on_hold}
+{if $form.email_on_hold.type == 'select'}
+
+ {$form.email_on_hold.label}
+
+ {$form.email_on_hold.html}
+
+{elseif $form.email_on_hold.type == 'checkbox'}