Sending a message to a subscription applicant when a subscription request is made
Dear Mailman 3 wizards,
Our subscription process requires that the applicant answers a few questions and sends them to the list moderator. Not having a template that gets sent on all subscribe requests, I'm using the 'list:admin:action:subscribe' template. This gets sent to the list moderator, who then sends it forward to the applicant. This is rather tedious. I would like the template to be sent directly to the applicant.
There is a template, 'list:user:action:subscribe' that almost does this, but it gets sent only if the email address of the applicant is unverified. A good number of our applicants are already on our lists, so they would not get this template if we set the Subscription Policy to 'Confirm, then moderate'.
Our Subscription Policy is currently: 'Moderate' for all lists.
I figure that three modifications can be used to fix this:
a. That we change the lines in the Python program in our installation that send 'list:admin:action:subscribe' to the list admins to instead send the template to the applying subscriber.
b. That we change the lines in the Python program in our installation that send 'list:user:action:subscribe' to the subscriber with an unverified address to always do this, even when the incoming address has already been verified.
c. That the current 'list:user:action:subscribe' be changed in published Mailman 3 source to 'list:user:action:confirm' and a new template ''list:user:action:subscribe' be set up to be sent when any subscribe request is made. This is more work, of course, so not likely a good thing to hack locally. It could be useful to other users.
Any suggestions on how to best and most quickly do the above would be appreciated, starting with (a.) or (b.).
Clearly, (a.) and (b.), if we do one of those, are hacks that will need to be applied upon Mailman updates. That's fine by me, as I'm in rush to get this done. I'd welcome pointers as to which file to change and how. Of these two options, which would be the least work?
(c.) could be entered as a longer-term enhancement request. I can submit that request if you like.
Yours,
Allan Hansen
P.S.: Thank you for the enhancement that lets moderators see the member lists. It has been a big help for us.
GNU Mailman 3.3.8 (Tom Sawyer) Python 3.9.2 (default, Feb 28 2021, 17:03:44) [GCC 10.2.1 20210110] config file: /opt/mailman/mm/mailman.cfg db url: postgresql://mailman:VWy26K4pUfU4jw@localhost/mailman devmode: DISABLED REST root url: http://localhost:8001/3.1/ REST credentials: restadmin:restpass
On 3/28/23 01:49, Allan Hansen wrote:
There is a template, 'list:user:action:subscribe' that almost does this, but it gets sent only if the email address of the applicant is unverified. A good number of our applicants are already on our lists, so they would not get this template if we set the Subscription Policy to 'Confirm, then moderate'.
Our Subscription Policy is currently: 'Moderate' for all lists.
If you set the subscription policy to 'Confirm, then moderate' the user will receive a confirmation request based on the list:user:action:subscribe template whether or not the address is verified.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
Mark,
I tried doing this. I unsubscribed myself from a list, set the policy as you suggest and re-applied. I got no confirmation messages but as moderator I got the moderate message. I then tried a bogus email and saw that a message was sent to that and no moderator message to me. Would the server skip the verification message because I'm a moderator/admin?
Yours,
Allan
On 3/28/23, 08:57, "Mark Sapiro" <mark@msapiro.net <mailto:mark@msapiro.net>> wrote:
On 3/28/23 01:49, Allan Hansen wrote:
There is a template, 'list:user:action:subscribe' that almost does this, but it gets sent only if the email address of the applicant is unverified. A good number of our applicants are already on our lists, so they would not get this template if we set the Subscription Policy to 'Confirm, then moderate'.
Our Subscription Policy is currently: 'Moderate' for all lists.
If you set the subscription policy to 'Confirm, then moderate' the user will receive a confirmation request based on the list:user:action:subscribe template whether or not the address is verified.
-- Mark Sapiro <mark@msapiro.net <mailto:mark@msapiro.net>> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
Mailman-users mailing list -- mailman-users@mailman3.org <mailto:mailman-users@mailman3.org> To unsubscribe send an email to mailman-users-leave@mailman3.org <mailto:mailman-users-leave@mailman3.org> https://lists.mailman3.org/mailman3/lists/mailman-users.mailman3.org/ <https://lists.mailman3.org/mailman3/lists/mailman-users.mailman3.org/> Archived at: https://lists.mailman3.org/archives/list/mailman-users@mailman3.org <mailto:mailman-users@mailman3.org>/message/ORDAIBK4JUICZADYPEPWDVV2WP5EXWEB/
This message sent to hansen@rc.org <mailto:hansen@rc.org>
On 3/28/23 09:19, Allan Hansen wrote:
Mark,
I tried doing this. I unsubscribed myself from a list, set the policy as you suggest and re-applied. I got no confirmation messages but as moderator I got the moderate message.
How did you reapply? with the subscribe policy confirm then moderate a new subscriber should get the list:user:action:subscribe message and have to confirm before the request waits moderation? However, see below.
I then tried a bogus email and saw that a message was sent to that and no moderator message to me. Would the server skip the verification message because I'm a moderator/admin?
It's not because you are an admin. It's because you were logged in when you subscribed from the list's info page. You will need to confirm if you subscribe anonymously without logging in or subscribe via email, but if you are logged in to Postorius when you request subscription, that is sufficient confirmation that the request really comes from you, so you don't get an email confirmation.
So, depending on your circumstances, this may or may not work for you.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
Thank you, Mark. That makes sense.
And, as you suggested, this will not work for me, because a lot of people log in and then apply to more lists. I can't exhort them to get the accounts set up and do their subscription maintenance while logged in, and they tell them that if they want to sign up for another list they have to log out first. __
I do need to find another way. I suggested these options:
a. That we change the lines in the Python program in our installation that send 'list:admin:action:subscribe' to the list admins to instead send the template to the applying subscriber.
b. That we change the lines in the Python program in our installation that send 'list:user:action:subscribe' to the subscriber with an unverified address to always do this, even when the incoming address has already been verified.
c. That the current 'list:user:action:subscribe' be changed in published Mailman 3 source to 'list:user:action:confirm' and a new template ''list:user:action:subscribe' be set up to be sent when any subscribe request is made. This is more work, of course, so not likely a good thing to hack locally. It could be useful to other users.
Of course, (a.) and (b.) are preferred in the short term, as I'd like to get our procedure simplified. Any idea which file to change for either, and some suggestion as to what to change?
Yours,
Allan
On 3/28/23, 10:18, "Mark Sapiro" <mark@msapiro.net <mailto:mark@msapiro.net>> wrote:
On 3/28/23 09:19, Allan Hansen wrote:
Mark,
I tried doing this. I unsubscribed myself from a list, set the policy as you suggest and re-applied. I got no confirmation messages but as moderator I got the moderate message.
How did you reapply? with the subscribe policy confirm then moderate a new subscriber should get the list:user:action:subscribe message and have to confirm before the request waits moderation? However, see below.
I then tried a bogus email and saw that a message was sent to that and no moderator message to me. Would the server skip the verification message because I'm a moderator/admin?
It's not because you are an admin. It's because you were logged in when you subscribed from the list's info page. You will need to confirm if you subscribe anonymously without logging in or subscribe via email, but if you are logged in to Postorius when you request subscription, that is sufficient confirmation that the request really comes from you, so you don't get an email confirmation.
So, depending on your circumstances, this may or may not work for you.
-- Mark Sapiro <mark@msapiro.net <mailto:mark@msapiro.net>> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
Mailman-users mailing list -- mailman-users@mailman3.org <mailto:mailman-users@mailman3.org> To unsubscribe send an email to mailman-users-leave@mailman3.org <mailto:mailman-users-leave@mailman3.org> https://lists.mailman3.org/mailman3/lists/mailman-users.mailman3.org/ <https://lists.mailman3.org/mailman3/lists/mailman-users.mailman3.org/> Archived at: https://lists.mailman3.org/archives/list/mailman-users@mailman3.org <mailto:mailman-users@mailman3.org>/message/D4WXXVOHXTDLRDGXV66GV4BAMWBRYEPF/
This message sent to hansen@rc.org <mailto:hansen@rc.org>
On 3/28/23 10:45, Allan Hansen wrote:
a. That we change the lines in the Python program in our installation that send 'list:admin:action:subscribe' to the list admins to instead send the template to the applying subscriber.
This patch will do that ``` --- a/src/mailman/app/subscriptions.py +++ b/src/mailman/app/subscriptions.py @@ -338,7 +338,7 @@ class SubscriptionWorkflow(_SubscriptionWorkflowCommon): # This message should appear to come from the <list>-owner so as # to avoid any useless bounce processing. msg = UserNotification( - self.mlist.owner_address, self.mlist.owner_address, + self.address.email, self.mlist.owner_address, subject, text, self.mlist.preferred_language) msg.send(self.mlist) # The workflow must stop running here. ``` Watch for wrapped lines. Note that this only works if Admin immed notify is Yes.
b. That we change the lines in the Python program in our installation that send 'list:user:action:subscribe' to the subscriber with an unverified address to always do this, even when the incoming address has already been verified.
I think this patch will do it, but needs testing ``` --- a/src/mailman/app/subscriptions.py +++ b/src/mailman/app/subscriptions.py @@ -285,7 +285,7 @@ class SubscriptionWorkflow(_SubscriptionWorkflowCommon): # If we do not need the user's confirmation, then skip to the # moderation checks. if self.mlist.subscription_policy is SubscriptionPolicy.moderate: - self.push('moderation_checks') + self.push('send_confirmation') return # If the subscription has been pre-confirmed, then we can skip the # confirmation check can be skipped. If moderator approval is ``` Again watch for wrapped lines. -- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
Much appreciated, Mark. We'll go with (a.), as it's a one-liner as I expected, and it does not require me to change the policy. I'll just need to make some adjustments to the template contents. Yours, Allan On 3/28/23, 11:29, "Mark Sapiro" <mark@msapiro.net <mailto:mark@msapiro.net>> wrote: On 3/28/23 10:45, Allan Hansen wrote:
a. That we change the lines in the Python program in our installation that send 'list:admin:action:subscribe' to the list admins to instead send the template to the applying subscriber.
This patch will do that --- a/src/mailman/app/subscriptions.py +++ b/src/mailman/app/subscriptions.py @@ -338,7 +338,7 @@ class SubscriptionWorkflow(_SubscriptionWorkflowCommon): # This message should appear to come from the <list>-owner so as # to avoid any useless bounce processing. msg = UserNotification( - self.mlist.owner_address, self.mlist.owner_address, + self.address.email, self.mlist.owner_address, subject, text, self.mlist.preferred_language) msg.send(self.mlist) # The workflow must stop running here. Watch for wrapped lines. Note that this only works if Admin immed notify is Yes.
b. That we change the lines in the Python program in our installation that send 'list:user:action:subscribe' to the subscriber with an unverified address to always do this, even when the incoming address has already been verified.
I think this patch will do it, but needs testing --- a/src/mailman/app/subscriptions.py +++ b/src/mailman/app/subscriptions.py @@ -285,7 +285,7 @@ class SubscriptionWorkflow(_SubscriptionWorkflowCommon): # If we do not need the user's confirmation, then skip to the # moderation checks. if self.mlist.subscription_policy is SubscriptionPolicy.moderate: - self.push('moderation_checks') + self.push('send_confirmation') return # If the subscription has been pre-confirmed, then we can skip the # confirmation check can be skipped. If moderator approval is Again watch for wrapped lines. -- Mark Sapiro <mark@msapiro.net <mailto:mark@msapiro.net>> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan _______________________________________________ Mailman-users mailing list -- mailman-users@mailman3.org <mailto:mailman-users@mailman3.org> To unsubscribe send an email to mailman-users-leave@mailman3.org <mailto:mailman-users-leave@mailman3.org> https://lists.mailman3.org/mailman3/lists/mailman-users.mailman3.org/ <https://lists.mailman3.org/mailman3/lists/mailman-users.mailman3.org/> Archived at: https://lists.mailman3.org/archives/list/mailman-users@mailman3.org <mailto:mailman-users@mailman3.org>/message/NNMWW4PW55H4OLA3NTAKZLRNIEV2HHUA/ This message sent to hansen@rc.org <mailto:hansen@rc.org>
participants (2)
-
Allan Hansen
-
Mark Sapiro