Skip to content

Commit

Permalink
CiviMail - Switch to APIv4 autocomplete to select recipients
Browse files Browse the repository at this point in the history
This uses an autocomplete callback with UNIONs to select from both groups and mailings,
but instead of a single widget for incluce/exclude it provides two widgets for better usability.
  • Loading branch information
colemanw committed Jun 13, 2023
1 parent 4332a9a commit 8c08ff2
Show file tree
Hide file tree
Showing 4 changed files with 66 additions and 359 deletions.
12 changes: 4 additions & 8 deletions ang/crmMailing/BlockRecipients.html
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
<div ng-controller="EditRecipCtrl" class="crm-mailing-recipients-row">
<input
type="hidden"
crm-mailing-recipients
ng-model="mailing.recipients"
crm-mandatory-groups="crmMailingConst.groupNames | filter:{is_hidden:1}"
crm-ui-id="{{crmMailingBlockRecipients.id}}"
name="{{crmMailingBlockRecipients.name}}"
ng-required="true" />
<i class="crm-i fa-plus-square-o"></i>
<crm-mailing-recipients-autocomplete ng-if="mailing" crm-recipients="mailing.recipients" crm-mailing-id="mailing.id" crm-mode="include"></crm-mailing-recipients-autocomplete>
<i class="crm-i fa-minus-square-o"></i>
<crm-mailing-recipients-autocomplete ng-if="mailing" crm-recipients="mailing.recipients" crm-mailing-id="mailing.id" crm-mode="exclude"></crm-mailing-recipients-autocomplete>
<a crm-icon="fa-wrench" ng-click="editOptions(mailing)" class="crm-hover-button" title="{{:: ts('Edit Recipient Options') }}"></a>
<div ng-style="{display: permitRecipientRebuild ? '' : 'inline-block'}">
<button ng-click="rebuildRecipients()" ng-show="permitRecipientRebuild" class="crm-button" title="{{:: ts('Click to refresh recipient count') }}">{{getRecipientsEstimate()}}</button>
Expand Down
7 changes: 1 addition & 6 deletions ang/crmMailing/EditRecipCtrl.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,7 @@
var SETTING_DEBOUNCE_MS = 5000;
var RECIPIENTS_PREVIEW_LIMIT = 50;

var ts = $scope.ts = CRM.ts(null);

$scope.isMailingList = function isMailingList(group) {
var GROUP_TYPE_MAILING_LIST = '2';
return _.contains(group.group_type, GROUP_TYPE_MAILING_LIST);
};
var ts = $scope.ts = CRM.ts();

$scope.recipients = null;
$scope.outdated = null;
Expand Down
345 changes: 0 additions & 345 deletions ang/crmMailing/Recipients.js

This file was deleted.

Loading

0 comments on commit 8c08ff2

Please sign in to comment.