/* Create the mailing group record */
$mg = new CRM_Mailing_DAO_MailingGroup();
+ $groupTypes = array('include' => 'Include', 'exclude' => 'Exclude', 'base' => 'Base');
foreach (array('groups', 'mailings') as $entity) {
foreach (array('include', 'exclude', 'base') as $type) {
if (isset($params[$entity][$type])) {
- self::replaceGroups($mailing->id, $type, $entity, $params[$entity][$type]);
+ self::replaceGroups($mailing->id, $groupTypes[$type], $entity, $params[$entity][$type]);
}
}
}
_.each(groupResult.values, function (mailingGroup) {
var bucket = (/^civicrm_group/.test(mailingGroup.entity_table)) ? 'groups' : 'mailings';
var entityId = parseInt(mailingGroup.entity_id);
- mailing[bucket][mailingGroup.group_type].push(entityId);
+ mailing[bucket][mailingGroup.group_type.toLowerCase()].push(entityId);
});
});
},