Chapter 9: Email
Enabling Notifications
Problem
You want to allow your readers to sign up to receive e-mail notifications.
Solution
Place a notification subscription form in your layout.
Discussion
Movable Type includes the ability to easily send an email notification to readers to alert them of new posts.
You can use the mt-add-notify.cgi script, along with a small HTML form in your templates, to provide simple subscription services to readers.
mt-add-notify.cgi allows readers to subscribe to and unsubscribe from a weblog's notifications list after a confirmation step to check that the email address is valid.
Prior to version 3.0D, this script only handled subscriptions, hence the "add" in the name. If it bothers you, you can rename the file and point your forms at the renamed script.
To make these features available to readers, you will need to insert some HTML code like that in the example below into one or more of your templates:
<form method="post" action="<$MTCGIPath$>mt-add-notify.cgi">
<input type="hidden" name="blog_id" value="<$MTBlogID$>" />
<input type="hidden" name="_redirect" value="<$MTBlogURL$>" />
<input name="email" size="20" />
<input type="submit" value="add" />
</form>
clean up form -- label, ids etc. what about unsubscribing???? do not hard code script name. use tag instead. what about localization?




Comments
Undocumented:
To use the suggested form you first need to have added a line like this to /cgi-bin/mt-config.cgi:
EmailVerificationSecret "mashed6potatos"
You need to set the EmailAddressMain configuration value to your own email address in mt-config.cgi:
EmailAddressMain name@domain.com
Not mentioned:
There is a Name field in the database that is not accessible through the admin UI. For some unknown reason a URL is gathered.
The "thank you" page is bare and ugly, with no links back to the originating page or to the home page. It is edited in a CGI script and is not intuitive to change.
Not explained:
What is the relationship between this "subscription" (for notifications) and becoming an approved commenter for the Comment function?
Posted by: DD
|
November 20, 2005 05:09 PM