After upgrade to 4.7.31 / working with Wordpress 4.9.4 I face problems with sending mass e-mails (Rundschreiben): I can choose groups (mailing list groups) in the recipients section, but the estimation shows "no recepients"; I can send test emails to a single email address or a group, and it works. I can start the sending process, but no e-mails are being sent. Any hints on how to solve this problem?
I resolved this by going to Adminstrater > System Settings > Clean up cache and update paths. Click the Clean up cache button.
I did some extensive debugging, looking at the various SQL queries and found the following problem that affects those of us not using en_US as the language:
./CRM/Mailing/BAO/Mailing.php has the getRecipients function, and it has the following line: $dao = CRM_Utils_SQL_Select::from('civicrm_mailing_group') ->select('GROUP_CONCAT(entity_id SEPARATOR ",") as group_ids, group_type, entity_table') ->where('mailing_id = #mailing_id AND entity_table IN ("civicrm_group", "civicrm_mailing")') ->groupBy(array('group_type', 'entity_table')) ->param('#mailing_id', $mailingID) ->execute();
The problem is that for non-en_US languages, civicrm_mailing_group table has the language-specific view as the entity table, so in my case civicrm_group_en_GB, not civicrm_group, so the recipients are never found. This code snippet solves the problem - I've yet to submit a patch.
$mailingGroup = new CRM_Mailing_DAO_MailingGroup(); $mgtable = CRM_Mailing_DAO_MailingGroup::getTableName(); $group = CRM_Contact_BAO_Group::getTableName(); $recipientsGroup = $excludeSmartGroupIDs = $includeSmartGroupIDs = $priorMailingIDs = array(); $dao = CRM_Utils_SQL_Select::from($mgtable) ->select('GROUP_CONCAT(entity_id SEPARATOR ",") as group_ids, group_type, entity_table') ->where('mailing_id = #mailing_id AND entity_table IN ("' . $group . '", "' . $mailing . '")') ->groupBy(array('group_type', 'entity_table')) ->param('#mailing_id', $mailingID) ->execute();
This bug is marked as being fixed in 5.0 - you should upgrade to the latest release (currently 5.1.2) to get the fix