Table of Contents

Subscribe and Unsubscribe to mailman in a simple webform

Subscribing and Unsubscribing to a mailman-list is still quite a big step for many users, cause you have to leave the webpage, read tech-text, answer to strange questions, even pick a password .... and rarely users do so.

We need a much simpler solution : a simple form inside your webpage where the user enter its mailadress and eventually needs to confirm the subscription via a nice and understandable email.

Subscription

The code for your webform

This is the easy part. Just put the following part in your webpage. Dont forget to replace <SERVERNAME> and <LISTNAME> with your server and your list. For my customers <SERVERNAME> would be goldfisch.at and listname the name of your list.

 <FORM Method=POST ACTION="http://<SERVERNAME>/mailman/subscribe/<LISTNAME>"><br>
 Your E-mail address: <INPUT type="Text" name="email" size="30" value=""><br>
 <INPUT type="Submit" name="email-button" value="Subscribe">
 </FORM>



note: You can specify more parameters as pointed out in mailman-FAQ but this is only for experts making interfaces for experts which most users are not !!

customize the result-page

After you press submit in your new form, your user will get to mailman-subscription-result-page. This looks very technical by default and not like your webpage and some users might not get back to your original homepage. So better create a customized page. You can enter the code in the mailman-options of your list. Logon to the administrative Interface of your list (ie: http://goldfisch.at/mailman/admin/<LISTNAME> on my server) and click on Edit the public HTML pages and text files and then on Subscribe results page and voila : feel free to enter whatever you like.

To minimize effort here I would recommend a color similar to your webpage, a small message that says “thank you” and optionally that you will receive a confirmation-email shortly where you need to reply ... I would also recommend a redirect to your original page or at least a javascript - BACK-BUTTON or something like that. Or you change the above form, so that the subscription-result is shown in a own window or ... :)

Customizing the confirmationmail

If your list-setup requests confirmation of any subscription, then the user will get an email describing steps how to confirm. Usually this is reply to the mail with keeping the subject mostly intact. Or visiting a certain webpage.

To customize this email, you need to ask your systemadminstrator to do this for you. He needs to put the customized text in the file:

mailman/lists/<LISTNAME>/en/verify.txt

Take the default-file from mailman/templates/en/verify.txt as blueprint or take a look at my german version below.
The exact location can vary and the file must be readable by mailman-user/group.

Unfortunately the subject of this confirmation-mail contains the confirmation-code and therefore cannot be changed and does not look rather nice :)

example for a very friendly and nonformal german version:

Willkommen auf der %(listname)s - Mailingliste.

Damit dich niemand anderer ohne dein Wissen anmelden kann, 
musst du die Anmeldung noch bestaetigen.

Am einfachsten gehts das, wenn du auf dieses email antwortest 
ohne irgendwas zu veraendern. (Einfach Antworten clicken und Senden)

Wenn das nicht geht, dann kannst du einfach auf folgende Webseite gehen:

    %(confirmurl)s


Wenn Du dich nicht angemeldet hast, sondern wer anderer, dann dieses mail 
bitte einfach ignorieren und du wirst keine mails mehr bekommen.

Angemeldet wurdest du uebrigens mit der Adresse %(email)s von der IP %(remote)s

Unsubscribing

Unsubscribing is more difficult but nevertheless very necessary. You dont want to run one of this mailinglists where you never get off again?

Unfortunately I havent figured out a way like above where you simply add your adress in a form-field and press submit.

Unsubscribing by visiting a very special url

However there is a one-click-way:

http://<SERVERNAME>/mailman/options/<LISTNAME>/<ADRESS>?unsub=Unsubscribe;unsubconfirm=1


Unfortunately the link includes the users mailadress and you need to instruct him how to to create this link.

Unsubscribing via a webform



In fact you could use a simple cgi-script to read the address-input-field and then create a “unscribe-mail” and send it to mailman-request. Interesting attempt, but I havent tried yet.
The following atempt might work (untested):

<FORM action="http://yourdomain.com/mailman/options/LISTNAME" method="POST" >

<INPUT name="email" type="text" value="">
<INPUT name="login-unsub" type="SUBMIT" value="Unsubscribe" >
</FORM>

Customizing the resultpage

???

Customizing the confirmation-mail

Same as for subscription but the filename is unsub.txt instead of verify.txt