Recently in Email Category

This article was first published at Movable Tweak.

This little snip of code will dump out a list of all the users and their email addresses on your install in a comma-delimited format that you can easily import into your email client. It’s particularly useful on larger installs:

<mt:Authors include_blogs="all">
    <mt:IfNonEmpty tag="AuthorEmail">
        <mt:IfNonEmpty tag="AuthorDisplayName">"<mt:AuthorDisplayName />" </mt:IfNonEmpty>
        &lt;<mt:AuthorEmail />&gt;,
    </mt:IfNonEmpty>
</mt:Authors>

And the Authors tag allows for all sorts of cool filtering attributes so you can get at any group of authors in the system, ordered however you like:

  • display_name: Specifies a particular author to select.
  • lastn: Limits the selection of authors to the specified number.
  • sortby: Supported values: displayname, name, created_on.
  • sort_order: Supported values: ascend, descend.
  • roles: comma separated list of values. eg “Author, Commenter”
  • need_entry: 1 | 0 (default is 1)
  • status: Supported values: enabled, disabled. Default is enabled.

Note: Some people have asked about creating an email list of all the commenters on the system, and it’s very simple. The code stays the same, but you just need to specify roles=”Commenter” and need_entry=”0” (since most commenters won’t have written an entry). Here’s the code to do it:

 <mt:Authors include_blogs="all" roles="Commenter" need_entry="0" sort_by="display_name"><mt:IfNonEmpty tag="AuthorEmail"><mt:IfNonEmpty tag="AuthorDisplayName">"<mt:AuthorDisplayName />" </mt:IfNonEmpty>&lt;<mt:AuthorEmail />&gt;, </mt:IfNonEmpty>
 </mt:Authors>

Notice the code is much more compressed than the code given previously. If you tried the previous code, you probably noticed that the spacing is crazy because of all the hard returns and spaces we have in there. This second set of code I posted will give you a highly compact list of email addresses than can literally be copied and pasted into an email client.

Just make sure you use this for good, not evil.

Create a Contact Form using MT4

| 9 Comments

I have used the contact form on previous versions of Movable Type following the instructions from Learning Movable Type and it’s always worked well. Trying to implement it in MT4 has proved more difficult because of the way the templates are set up using modules. Several templates need to be modified to get this to work.

Creating a Contact Form using MT

| 11 Comments
There is a new LMT tutorial for Creating a contact form using MT4, written by Toni Hambilton. Please see it if you are using MT4. The following tutorial will not work for MT4 but is appropriate for MT3.

The problem with most "Email me" contact forms is that they aren't very secure. I've been using one of these forms for a few years and recently started getting a lot more spam messages coming through to my email inbox. MT developer Jay Allen suggested using his Comment Challenge plugin and the commenting capability of MT to create a more secure contact form. I've implemented this approach on elise.com and it seems to work great. Here are the steps. You will need to create a new blog for this purpose if you have enabled comments on your existing blog (the comment system templates will conflict otherwise).

"Email Me" Contact Forms

| 11 Comments

Providing contact information on your weblog can be useful to your site visitors who may want to email you directly rather than submit a comment to one of your entries. You can choose to write out your email address, provide a mailto link (see MailTo Syntax for how to write out a mailto hyperlink), or you can provide a contact form. Contact forms are often preferred because they can easily hide your email address information from the spammers who regularly scour the web looking for email addresses to harvest.

I have researched and tested two free PHP-based contact form scripts - TheSiteWizard Feedback form and DodosMail - either of which you can easily implement to add a contact form to your site.

Update May 4, 2007 You can also use Movable Type to create a contact form (see Creating a Contact Form Using MT). This method utilizes Jay Allen's Comment Challenge plugin which provides a measure of security that the PHP-based contact forms lack.

TheSiteWizard.com Feedback Form Wizard

The easiest form to implement is the SiteWizard feedback form; the php script is available at thesitewizard.com. SiteWizard also offers a Perl-based CGI script if your server does not support PHP.

Follow the directions listed to customize the feedback.php script so that it uses your email address and load the script onto your server. Set the permissions of the script to 644. You will need to create 3 html pages (or php pages if you plan to use a php include for the form) on your website to support this script: a Feedback Form page, a Thank You page, and an Error Page. An easy way to do this is to create 4 new index templates in your weblog, one each for the script, the form, the thank you, and the error page. (Make sure to uncheck the "rebuild this template automatically" checkbox if you use this method. No need to add unnecessary rebuilds.) You can also separate out the form into a .inc template module and use a PHP include (see Using PHP and MT Includes) to pull it into the form's page. This way, if you have multiple weblogs, you can use the same form, but pulled into different pages.

About this Archive

This page is an archive of recent entries in the Email category.

Dynamic Publishing is the previous category.

Exploring MT is the next category.

Find recent content on the main index or look in the archives to find all content.