Add Unsubscribe Function to MovableType
By Jian Shuo Wang on 2002-10-28 22:59 · MovableTypeAdding unsubscription function into MovableType has been a very hot topic in MovableType Support Forum (refer to this post and that one.
Tonight, I spent some time to think about it and changed the code a little bit to support unsubscription function.
mt-add-notify.cgi
my $note = MT::Notification->new;
$note->blog_id( $q->param(‘blog_id’) );
$note->email( $q->param(’email’) );
$note->url( $q->param(‘url’) );
$note->save;
As you can see, I added a line into the code - as shown in red. I am using the existing *URL *field to add a tag of unsubscription. By utilizing existing fields, we reduce the code changes.
Result for subscription
By default, MovableType does not offer the subscription success confirmation page. It redirect users to the home page of the weblog by default. It is very confusing since subscribers don’t know what happened. We need to create one by yourself and change the _redirect input field of the subscription page. Refer to MovableType’s helpfor suggestions on adding “subscribe” function to your page.
Unsubscribe
I added a hidden field called URL with value of unsubscribe. Thus you can see the who is willing to unsubscribe from the notification list and do it manually when you notice it.
Want to have a try?
Please check the homepage of my weblog. The notification subscription area is at the right-top corner. You can also directly visit the subscription page.
Next step
It is ideal if we can add code for removing the Email from $note database directly in MT-add-notify.cgi. I don’t have time to do it now, but it should be very easy. Please let me know if you have done so.
2 Comments