StuffieStephie
has created a very nice Pen that has everything I need.
However even if I start using newer libraries I cannot get the email all filtered users to work - the outlook window pops up but the To list is empty
<div id="email-list" class="modal">
<div class="modal-content">
<div class="row"> <b ng-repeat="d in names | filter:filters">{{d.email}}{{$last ? '' : ', '}}</b></div>
</div>
</div>
<a ng-href="mailto:{{d.email}}{{$last ? '' : ', '}}" class="waves-effect waves-light btn margin-bottom-1em"><i class="material-icons left">email</i>Email All {{selected.field}} Volunteers ({{(names | filter:filters).length}})</a>
<a href="#email-list" class="modal-trigger waves-effect waves-light btn margin-bottom-1em">View List of Email Addresses ({{(names | filter:filters).length}})</a>
After $scope.names
is defined in the code, add this: (line 363)
$scope.emails = $scope.names.map(n => n.email).join(",");
Go to line 38, and change the function to this:
$scope.hasChanged = function() {
$scope.filters = $scope.selected.field;
var emails = $scope.names;
if ($scope.filters) emails = emails.filter(n => n.status == $scope.filters);
$scope.emails = emails.map(n => n.email).join(",");
}
In the email link part, use
ng-href="mailto:?bcc={{emails}}"
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.