For my purposes, I had to tweak the code to allow for the following features:
* List permissions- I have some email lists that can only site moderators should be on, and so I hooked this module into access control on a per-list basis. After applying these two patches, you will now have to set permissions for each list you create at Access Control (admin/user/access).***
* List descriptions- I needed short descriptions of the lists built in to the registration form, so I added that as a field. Each list's fieldset now shows a customizable description of the list.
* Digest optional- I did not want users subscribing in digest mode, so I made that option easily removable. It will be allowed by default (so current users will see no change), but you can go into user_mailman_register settings and turn off digest mode if you wish.
* "yes" is default during registration- To make it easier for the user, I added in one line of code to make the default value "YES" during new-user registration.

And one very minor change: fixed a spelling mistake in "partecipate".

These patches are against 5.x-1.2.

***NOTE: If you have set mailing list subscriptions to be displayed in the new user registration form, then keep in mind you will also have to make each list available for subcription to ANONYMOUS USERS via Access Control (admin/user/access). This is because, when a new user is first registering for the site, the only role they have is anonymous user (obviously). But don't worry-- random people won't be able to see the lists as long as you keep "access user_mailman_register" turned off for anonymous users.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

sbandyopadhyay’s picture

FileSize
7.08 KB
2.43 KB

So it turned out I need a few other features to be made optional, so while I was at it, I expanded on my above changes. This also adds the "force signup" feature requested by http://drupal.org/node/220664

These patches are ALSO against 5.x.-1.2. IGNORE MY PREVIOUS PATCHES ABOVE!! Use these two.

This new patch has all of the new features above, plus:
* Can turn off the "unsubscribe" option- this will force all users to join the list.
* Can turn off the "temporarily disable delivery" option- if available, this option can conflict with the automatic moderation features of mailman. I have my list set so that all new members are automatically moderated, but this could be bypassed by joining the list, temporarily disabling delivery, and then rejoining the list. And given how quick and user-friendly this module is -- you can entirely bypass all of Mailman's annoying, verbose emails to confirm this and confirm that -- there really isn't a need to temporarily disable delivery anymore, anyway. You might as well unsubscribe and then re-subscribe.

samuelet’s picture

FileSize
4.02 KB

Thanks sbandyopadhyay, it's a great work.
I'm going to test it.
For the moment i've updated the install patch to fix a bug with mysql and to manage drupal updates.
Just a note about default registration: i'd prefer to set it as NO and let the user the task to subscribe himself. Then i suppose that to force subscription, the unsubscribe option should be checked, and, in case it's off, the registration has to be turned into YES. What about it?

Thanks.

sbandyopadhyay’s picture

FileSize
15.24 KB

I had a few more feature requests, so I went ahead and coded them. I've combined these and all changes above into a single patch this time, so yet again, ignore the above patches and just use this one. I've also compiled a list of all changes in this patch (and the above ones) into one list:

  • Access Control- After applying this patch, this module will expose each list to Access Control (admin/user/access). This will allow some lists (say, a list for moderators) to be kept hidden from some users (say, non-moderators) on the registration form. A few caveats:
    • After applying this patch, all lists (including previously created ones) will need to have their access set (at admin/user/access) before they are visible on the registration form. This is an extra friction point for the admin, but I think it's well worth it for the extra feature.
    • If the mailing lists registration form is to be displayed during new user registration, then the admin should make the appropriate lists available not only to "authenticated users" but to "anonymous users" as well. This is because a new user first registering for the site has only one role: anonymous user. But don't worry-- random people won't be able to see the lists as long as you keep "access user_mailman_register" turned off for anonymous users.
  • Form UI- This patch includes a number of changes to the registration form, but none of them will be active by default. You will need to make the changes yourself at the user_mailman_register admin page to see them in effect.
    • List descriptions- Each list's fieldset now shows a customizable description of the list, making the form more user friendly. Admins can set the description for each list at the user_mailman_register admin page.
    • Optionally render the form in the "edit account" page, not its own page [NEW IN THIS PATCH]- Some admins might want to simplify the form navigation process for users, and put the mailing list registration form on the same page as other "edit account" forms (email address/password/picture/comment signature/etc.), rather than on a separate page. This patch allows admins to gracefully switch between either setting with the click of a checkbox.
    • Optionally turn off some choices for each list- Admins might have reason to want to turn off the options to "temporarily disable delivery", to get "digest delivery", or even to unsubscribe from a list! This patch allows some options to be turned off with the click of a checkbox on the user_mailman_register admin page.
      • Can turn off unsubscription- this effectively forces all users to join this list. There is no opt out.
      • Can turn off "temporarily disable delivery"- this option can sometimes act in unexpected ways (see above), and is practically obsolete now anyway given how quick and user-friendly this module is. You can entirely bypass all of Mailman's annoying, verbose emails to confirm this and confirm that -- you might as well just unsubscribe and then re-subscribe, which is just as easy and avoids any unexpected consequences.
      • Can turn off "digest delivery"- some admins might want to remove this option too, thereby forcing users who sign up for the list to receive every mail individually, not in a bundle.
    • "Yes" is default during registration- To make it easier for the user, the default value is "YES" during new-user registration.
  • Minor change: fixed a spelling mistake in "partecipate"

This patch is against 5.x-1.2.

sbandyopadhyay’s picture

Ah, sorry samuelet-- I just saw your comment after posting my new one. Sorry, my new patch didn't contain your updates to install.patch.

Regarding your comment about default registration... I would actually like to see the default be "yes" with an unsubscribe option available. I think the way to ensure maximum flexibility for admins might be to separate out the default option from which options are available, in a form something like this:

Default setting                                           Show option?
================                                          ============
[radio] Unsubscribe                                       [checkbox]
[radio] No mail (temporarily disable delivery)            [checkbox]
[radio] Subscribe for digest (receive emails in a bundle) [checkbox]
[radio] Subscribe for all Mail (normal delivery)          [checkbox]

I'll give it a shot, coding that... unless you want the honors. :)

sbandyopadhyay’s picture

Actually, wait-- my last post makes no sense. The default setting is a meaningless concept once the user has already signed up. It is only relevant on the new user registration page....

sbandyopadhyay’s picture

Title: Adding list permissions, description, and make digest optional » Incorporate with Access Control + More customizable Form UI
FileSize
17.89 KB

With this new patch to 5.x-1.2, I have:

  • Incorporated your changes from your updated install.patch -- but please give it another look over, particularly in the update function. I've never done update functions before, so I probably missed something.
  • Exposed the default during registration to customization by the admin. As you preferred, the default will be NO and the user will have the task of subscribing himself, unless:
    • the admin wants ALL lists to default to YES, and manually makes this change on the user_mailman_register admin page.
    • the admin is forcing subscription by making the "unsubscribe" option unavailable

    In these cases, the default will be YES.

samuelet’s picture

Status: Needs review » Fixed

Patch ported in the development release. I've only fixed the blank subscription form that appears when a user has any subscription access and made some cosmetic changes.
If any bugs will be reported, it will go in 5.x-1.3.
Thanks.

sbandyopadhyay’s picture

i haven't tested it yet, because my site is going into production tonight with the patched version from a few days ago... but that version was running just fine!

i looked through your code, it looks great, thanks samuelet! i will let you know if there are any bugs by later this week

samuelet’s picture

Status: Fixed » Closed (fixed)