Get An Email List of All Authors On Your System

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.

  • posted on 13 March 2008
  • by Jesse

InterAction:

13 March 20081. Justin Hamilton:

could you do the same thing for commenters?

14 March 20082. Jesse Gardner:

@Justin: Absolutely. In fact, the code is pretty much the same. I've updated the entry with details on how to do it.


YourThoughts?



(Minutia)

  • Author:
    Jesse
  • Published:
    Mar 13, 2008
  • Chapters:

GetUpdated

ElseWhere

Find me on aim Find me on delicious Find me on digg Find me on linkedin Find me on pownce Find me on twitter Find me on youtube Find me on skype Find me on facebook Find me on livejournal Find me on msn Find me on vox Find me on technorati Find me on yahoo Find me on dopplr Find me on lastfm

ActionStream

  • Jesse said, "Party at Liane's Place http://flic.kr/p/6BGZWy" Jesse said, “Party at Liane’s Place http://flic.kr/p/6BGZWy” 2009-07-03T23:10:19Z 2009-07-03T23:10:19Z
  • Jesse said, "I'm considering a new motto: "Your trouble ticket is my command."" Jesse said, “I’m considering a new motto: "Your trouble ticket is my command."” 2009-07-03T17:55:11Z 2009-07-03T17:55:11Z
  • Jesse said, "@kimonostereo Vibrant Ink: http://tr.im/qMSj" Jesse said, “@kimonostereo Vibrant Ink: http://tr.im/qMSj” 2009-07-03T17:49:51Z 2009-07-03T17:49:51Z
  • Jesse saved Nearest Tube Augmented Reality App for iPhone 3GS from acrossair as a favorite video Jesse saved Nearest Tube Augmented Reality App for iPhone 3GS from acrossair as a favorite video 2009-07-03T16:00:06Z 2009-07-03T16:00:06Z
  • Jesse said, "And if you haven't yet, download and read through Jon Hick's Icons for Interaction presentation. Pure gold. http://tr.im/qLKK" Jesse said, “And if you haven’t yet, download and read through Jon Hick’s Icons for Interaction presentation. Pure gold. http://tr.im/qLKK” 2009-07-03T15:06:11Z 2009-07-03T15:06:11Z