foreach ($contactEmails as $emailId => $item) {
$email = $item['email'];
- if (!$email &&
- (count($emails) <= 1)
- ) {
- $emails[$emailId] = '"' . $fromDisplayName . '"';
+ if (!$email && (count($emails) < 1)) {
+ // set it if no emails are present at all
$form->_noEmails = TRUE;
}
else {
$emails[$emailId] = '"' . $fromDisplayName . '" <' . $email . '> ';
$form->_onHold[$emailId] = $item['on_hold'];
+ $form->_noEmails = FALSE;
}
}
$form->_emails[$emailId] = $emails[$emailId];
-
$emails[$emailId] .= $item['locationType'];
if ($item['is_primary']) {
$emails[$emailId] = htmlspecialchars($emails[$emailId]);
}
+ CRM_Core_Error::debug($form->_noEmails, $emails); exit();
+
$form->assign('noEmails', $form->_noEmails);
if ($form->_noEmails) {