I need the functionality of importing all drupal users to a (new) mailing list. Ideally I'm thinking about a little button "add all (drupal) users to mailing list".
I could implement this. So that on cron run it'd call _user_mailman_register_subscribe() for every user. Would you like to see this functionality within this module? Depending on your decision I would write a patch instead of a custom (not public) module.
Comments
Comment #1
samuelet commentedEvery new patch is always welcome for reviewing, but consider that this feature could it be already achieved with the "Sync with roles" option.
I did not test it because this option is quite new, but it should work.
Create an UMR list (i.e: "My list") and set the "Sync with roles" option. Unset the "Allow unsubscribe" option if you want deny your users to unsubscribe it from form.
Give the "can subscribe to My list" permission to the "authenticated user" role.
You could also consider to completely deny the UMR form instead of simply deny the "Allow unsubscribe" unsetting the "access user_mailman_register" permission.
Now, every new user should be automatically subscribed when it's created.
To register already created users, you need to change their role, so you could create a temporary role with no particular permission, and give it to all your users. The role changing will trigger the "Sync with roles" option and your users will be subscribed for the "authenticated user" role permission. Finally, you can delete the temporary role.
Comment #2
davidbessler commentedThis worked great for me in ADDING a user. Is UMR supposed to remove the member from the list when their role is removed? If so, how long should it take before that is reflected? because for me it didn't work.
Comment #3
samuelet commented#2:
Yes it also unsubscribe a user which lost the "can subscribe to ..." role permission.
Your problem seems of a different source, probably related to #687198: Strange behaviour with emails containing the + char. Your first step is to solve that issue.
Comment #4
pdickey commentedThis workaround will work, but it shouldn't be the recommended way of doing it. It would be really nice if there was an option to force a sync for all users without adding everyone to a role and then removing it.
Comment #5
rjlang commentedSorry, no further changes will happen on versions 5.x and 6.x.