Changing delivery mode for ALL subscribers on a SINGLE list using REST
While in Mailman Settings a user can change delivery mode for either Global (all subscriptions regardless of address or list), Address based (regardless of list name) or List Based (regardless of address).
The list admin can change a user's delivery mode setting on a single list (affecting only that address and only that list), but only one subscriber at the time on the list.
Changing a user's delivery mode can also be done using REST[1], but I asume this will affect the user's subscription on all the lists where she subscribed using the same address.
How do I change ALL the subscribers[2] on a _single list_ to a certain delivery mode, using REST?
[1] https://mailman.readthedocs.io/en/latest/src/mailman/rest/docs/preferences.h... [2] Most likely by iterating through all subscribers, one at the time, on the list in question.
On Mon, Feb 18, 2019, at 4:56 AM, Henrik Rasmussen wrote:
While in Mailman Settings a user can change delivery mode for either Global (all subscriptions regardless of address or list), Address based (regardless of list name) or List Based (regardless of address).
The list admin can change a user's delivery mode setting on a single list (affecting only that address and only that list), but only one subscriber at the time on the list.
Changing a user's delivery mode can also be done using REST[1], but I asume this will affect the user's subscription on all the lists where she subscribed using the same address.
How do I change ALL the subscribers[2] on a _single list_ to a certain delivery mode, using REST?
You watch to PATCH the preferences of a Member object, so that you don't affect other subscriptions of that address or user.
http://localhost:9001/3.0/members/1/preferences
[1] https://mailman.readthedocs.io/en/latest/src/mailman/rest/docs/preferences.h... [2] Most likely by iterating through all subscribers, one at the time, on the list in question.
Mailman-users mailing list -- mailman-users@mailman3.org To unsubscribe send an email to mailman-users-leave@mailman3.org https://lists.mailman3.org/mailman3/lists/mailman-users.mailman3.org/
-- thanks, Abhilash Raj (maxking)
Thank you.
However, I've been trying to understand how that line refers to the list in question and to interpret the command. When I use it, I get a 404 error, but if I skip the 1 and preferences parts, just looking up all members
response = mmapi('members')
pprint(response.text)
def mmapi(apicommand):
response = requests.get('http://172.19.199.2:8001/%s/%s' % (restapiversion, apicommand),
auth=('restadmin', 'restpass'))
I get all members like this, but without a member id of 1.
{"address": ' '"http://172.19.199.2:8001/3.1/addresses/qqjokerz@gmail.com", ' '"delivery_mode": "regular", "email": "foo@example.com", "list_id": ' '"examplelist.listserver.ku.dk", "member_id": ' '"f1257245ba1149ee9e2d21507ed5530b", "role": "member", "self_link": ' '"http://172.19.199.2:8001/3.1/members/f1257245ba1149ee9e2d21507ed5530b", ' '"display_name": "", "user": ' '"http://172.19.199.2:8001/3.1/users/42991ae3e576415e8533c09a864f1547", ' '"http_etag": "\\"35cd857c98d4ed2e078c0ef3c1267842c2cba2fe\\""},
Can you give me an example of changing this particular member's subscription to examplelist.listserver.ku.dk using patch?
/Henrik
On Tue, Feb 19, 2019, at 1:56 AM, Henrik Rasmussen wrote:
Thank you.
However, I've been trying to understand how that line refers to the list in question and to interpret the command. When I use it, I get a 404 error, but if I skip the 1 and preferences parts, just looking up all members
response = mmapi('members') pprint(response.text) def mmapi(apicommand): response = requests.get('http://172.19.199.2:8001/%s/%s' %
(restapiversion, apicommand), auth=('restadmin', 'restpass'))
I get all members like this, but without a member id of 1.
{"address": ' '"http://172.19.199.2:8001/3.1/addresses/qqjokerz@gmail.com", ' '"delivery_mode": "regular", "email": "foo@example.com", "list_id": ' '"examplelist.listserver.ku.dk", "member_id": ' '"f1257245ba1149ee9e2d21507ed5530b", "role": "member", "self_link": ' '"http://172.19.199.2:8001/3.1/members/f1257245ba1149ee9e2d21507ed5530b", ' '"display_name": "", "user": ' '"http://172.19.199.2:8001/3.1/users/42991ae3e576415e8533c09a864f1547", ' '"http_etag": "\\"35cd857c98d4ed2e078c0ef3c1267842c2cba2fe\\""},
Can you give me an example of changing this particular member's subscription to examplelist.listserver.ku.dk using patch?
Sorry, I wrote half the reply.
So the URL should basically be:
http://examplelist.listserver.ku.dk/3.1/members/<member_id>/preferences
1 is basically the member-id and from your above example, I see that it is
"member_id": "f1257245ba1149ee9e2d21507ed5530b"
So,
http://examplelist.listserver.ku.dk/3.1/members/f1257245ba1149ee9e2d21507ed5530b/preferences
Should work for you.
P.S.: You could just append /preferences
to the self_link
of the member
resource you got above.
-- thanks, Abhilash Raj (maxking)
Abhilash Raj wrote:
So the URL should basically be:
http://examplelist.listserver.ku.dk/3.1/members/<member_id>/prefere...
Thank you, that helps me part of the way.
But as I use REST to comminucate with the Docker image using http://172.19.199.2:8001/3.1/ I cannot use http://examplelist.listserver.ku.dk/3.1/members to specify the list.
I need something to change all subscribers on a specific list to MIME Digest, either in one go or one by one using http://172.19.199.2:8001/3.1/members/[Member ID]/preferences something something.
-- Henrik
participants (2)
-
Abhilash Raj
-
Henrik Rasmussen