How do I put a subscribe form on my website?
How to put a list subscription form on your website
Note: If you are a ONE/Northwest client, and we have done a website project with you, then chances are that this functionality is already on your website. If you're not sure, or wish to add the Sympa subscription form please contact us.
If you have a Sympa list hosted by ONE/Northwest you can add a form to your website to accept subscriptions, and the easiest way is to have it invoke the customized CGI script that we provide for this purpose. You need to do two things:
- Notify us that you
will be using this script, so that we can add your domain to the list of
allowed senders for security reasons. Please note: This notification is only for people who have Sympa email lists hosted by ONE/Northwest. If that's not you, then there is no need to notify us, as we will ignore your request.
- Simply insert this HTML code snippet (or use it as a model) in your web page:
<form action="http://lists.onenw.org/cgi-bin/listsub.pl" method="post" target="_blank"> Enter your name:<br> <input type=text name="realname"><br> Enter your email address:<br> <input type=text name="email"><br> <input type=hidden name=listname value="LISTNAME"> <input type=hidden name=hostname value="HOSTNAME"> <input type=hidden name=action value="subscribe"> <input type=submit value="Subscribe"> </form>
Substitute the list you want people to subscribe to for LISTNAME, and for HOSTNAME substitute "lists.onenw.org" If you don't want to require the real name too, then just omit the lines that ask for it.
You can make other changes too, such as substituting a pull-down menu or radio buttons with multiple listnames to choose from, or changing the "subscribe" command to "unsubscribe", if you're comfortable editing forms. You can also set variables like a custom "thank you" page; this script is a hacked version of the standard NMS FormMail script, so see the instructions for that for details.
More details than you probably need
If you are looking to customize your subscription form beyond what this setup will allow, you can do that by installing the FormMail script or any other Web-to-email form on your Web server instead. One common motivation would be to accept additional subscriber information (address, comments, etc.), which there is no way to store in the ONE/Northwest list hosting system, but which you should be able to reroute separately for storage in your own local database. This will require a good bit more web programming savvy than just using our canned script, but any good web developer should be able to manage it. For the subscription requests to work, you just need to ensure that the form sends an email To: "LISTNAME-subscribe@lists.onenw.org" (or @lists.yourdomain.org if using a custom list hosting domain), and that it comes From: the subscriber's email address.
