diff --git a/src/views/email.js b/src/views/email.js
index 2d7edf980..67b701ecd 100644
--- a/src/views/email.js
+++ b/src/views/email.js
@@ -105,10 +105,12 @@ angular.module('Application').controller('EmailController', ['$scope', '$locatio
edit: {
busy: false,
error: null,
- list: null,
+ name: '',
+ members: [],
show: function (list) {
- $scope.mailinglists.edit.list = list;
+ $scope.mailinglists.edit.name = list.name;
+ $scope.mailinglists.edit.members = list.members.map(function (name) { return $scope.mailboxes.mailboxes.find(function (m) { return m.name === name; })});
$('#mailinglistEditModal').modal('show');
},
@@ -116,7 +118,9 @@ angular.module('Application').controller('EmailController', ['$scope', '$locatio
submit: function () {
$scope.mailinglists.edit.busy = true;
- Client.updateMailingList($scope.selectedDomain.domain, $scope.mailinglists.edit.list.name, $scope.mailinglists.edit.list.members, function (error) {
+ var members = $scope.mailinglists.edit.members.map(function (m) { return m.name; });
+
+ Client.updateMailingList($scope.selectedDomain.domain, $scope.mailinglists.edit.name, members, function (error) {
$scope.mailinglists.edit.busy = false;
if (error) return console.error(error);