diff --git a/src/postorius/templates/postorius/lists/members.html b/src/postorius/templates/postorius/lists/members.html
index f532595..8b99520 100644
--- a/src/postorius/templates/postorius/lists/members.html
+++ b/src/postorius/templates/postorius/lists/members.html
@@ -74,6 +74,10 @@
+
+
{% for member in list.member_page %}
diff --git a/src/postorius/urls.py b/src/postorius/urls.py
index 65459c9..2698edb 100644
--- a/src/postorius/urls.py
+++ b/src/postorius/urls.py
@@ -29,6 +29,8 @@
url(r'^members/(?P\d+)/$',
ListMembersView.as_view(
), name='list_members_paged'),
+ url(r'^csv_view/$',
+ 'csv_view', name='csv_view'),
url(r'^members/$',
ListMembersView.as_view(
), name='list_members'),
diff --git a/src/postorius/views/list.py b/src/postorius/views/list.py
index 6292bab..8919789 100644
--- a/src/postorius/views/list.py
+++ b/src/postorius/views/list.py
@@ -16,6 +16,9 @@
# You should have received a copy of the GNU General Public License along with
# Postorius. If not, see .
import logging
+import csv
+
+from django.http import HttpResponse
from django.contrib import messages
from django.contrib.auth.decorators import (login_required,
@@ -304,6 +307,29 @@
return redirect('mass_removal', self.mailing_list.list_id)
+@list_owner_required
+def csv_view(request, list_id):
+ """Export all the subscriber in csv
+ """
+ mm_lists = []
+ try:
+ client = utils.get_client()
+ mm_lists = client.get_list(list_id)
+ except MailmanApiError:
+ return utils.render_api_error(request)
+
+ response = HttpResponse(content_type='text/csv')
+ response['Content-Disposition'] = (
+ 'attachment; filename="Subscribers.csv"')
+
+ writer = csv.writer(response)
+ if mm_lists:
+ for i in mm_lists.members:
+ writer.writerow([i.email])
+
+ return response
+
+
def _get_choosable_domains(request):
try:
domains = Domain.objects.all()
|