TABLE OF CONTENTS › <txp:bab_pm_data />

This tag outputs a particular piece of data (article-, list- or subscriber-related) using the display="" attribute). It defaults to display="Body".

This example outputs the excerpt field of the article you mail from:

<txp:bab_pm_data display="Excerpt" />
NOTE: In 0.4, Textpattern tags are recognized. You can just as easily use <txp:excerpt /> when creating your templates, but the data tag can still be used to output article-related data (do note the changes to some of the display="" properties).

This example outputs the name of the subscriber:

<txp:bab_pm_data display="subscriberName" />

In addition, there is an optional strip_html="yes" attribute that, used in conjunction with display="body_html", takes the body of an article written using Textile and sends it as plain text (without either Textile or HTML1). Here is an example:

<txp:bab_pm_data display="Body_html" strip_html="yes" />

Here’s the full list of display="" options for this tag:

Article-related
  • display="Body"
  • display="link"
  • display="Excerpt"
  • display="Title"
  • display="Author"
  • display="Section"
  • display="Category1"
  • display="Category2"
  • display="Body_html"
  • display="Excerpt_html"
  • display="article_image"
  • display="comments_count"
  • display="keywords"
  • display="custom_1"
  • display="custom_2"
  • display="custom_3"
  • display="custom_4"
  • display="custom_5"
  • display="custom_6"
  • display="custom_7"
  • display="custom_8"
  • display="custom_9"
  • display="custom_10"
Subscriber-related
  • display="subscriberName"
  • display="subscriberEmail"
  • display="subscriberLists"
  • display="subscriberCustom1"
  • display="subscriberCustom2"
  • display="subscriberCustom3"
  • display="subscriberCustom4"
  • display="subscriberCustom5"
  • display="subscriberCustom6"
  • display="subscriberCustom7"
  • display="subscriberCustom8"
  • display="subscriberCustom9"
  • display="subscriberCustom10"

List-related

  • display="listName"
  • display="listDescription"
  • display="listAdminEmail"

1 This bit of trickery allows a user to write an article once, using Textile to markup the text (so that it will be bold on the Web site or italic in an HTML email) but have it mail in a text email as plain text. Textpattern translate the Textile markup into HTML, and then PM strips the HTML from the text. Users are advised to test this method thoroughly.

Back to the Table of Contents

Comment

Hi Ben,

please, could you add a trickery to insert the date when the email has been sent?

Like: “Our newsletter for [day, month, year]”

Maybe it can be done with simple and raw PHP (although I don’t know how).
Or also, maybe it can be easily done with <txp:posted /> (though it will output the date the article was posted, and what I’m asking is the date when the newsletter has been sent).

Maniquí · Feb 17, 08:33 AM · #

Also, does the trick to strip HTML work on excerpts? If so, is the display attribute “excerpt_html”?

Thanks.

Maniquí · Feb 17, 08:58 AM · #

Or also, maybe it can be easily done with <txp:posted /> (though it will output the date the article was posted, and what I’m asking is the date when the newsletter has been sent).

Don’t know why, but actually <txp:posted /> outputs the date corresponding to when the e-mail has been sent, and not the article’s posted date.

That’s great, but I don’t know if you would want to change this behaviour and make <txp:posted /> to output article’s poste date.

Maniquí · Feb 17, 11:22 AM · #

I would like to ask whether it is possible that the display="link" attribute outputs the nicely formed urls of the articles instead of the messy ones – as it does for me. Thanx, and keep up this wonderful, life-saving work :)

Zoltán · Apr 15, 02:30 AM · #

Textile Help

Official Documentation for Postmaster (A Textpattern Plugin)

Get Postmaster

RELATED

REGULARS

DISCLAIMER

Postmaster is a plugin for Textpattern, and is licensed under the GNU GPL. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public Licens for more details.