[Mailman-Developers] FW: A subscribe link, ATT Mark Sapiro

Mark Sapiro mark at msapiro.net
Wed Jul 20 05:36:57 CEST 2011

On 7/18/2011 11:42 PM, Clayton Brown wrote:
> I understand your comments below and suspected such an answer.
> Let me ask you this, you know what our needs are.
> I we were to ask you to code/modify mailman to our needs, would you do this?

Attached is the file Decorate.patch. If you apply this patch to
Mailman/Handlers/Decorate.py and restart Mailman, you can then do the

Create a file named 'body_template' in Mailman's lists/LISTNAME/
directory where LISTNAME is the name of a list that you want to add HTML
text to. The contents of the 'body_template' file can contain the same
replacements that can be used in msg_header or msg_footer. I.e. if and
only if the list is personalized, you can use replacements like
%(user_address)s and %(user_delivered_to)s.

The contents of the 'body_template' file should be valid HTML and
probably should be a <div> ... </div> division. It should be us-ascii
with non-ascii characters represented as HTML entities to avoid clashes
with the character set of the message body. If you want a literal '%'
character in the HTML, it must be doubled ('%%') in the 'body_template'
file so as not to be misinterpreted as a replacement leadin.

The group of the 'body_template' file should be Mailman's group and the
file group readable.

If you do that, the contents of the 'body_template' file with the
replacements appropriately replaced will be appended to the first
text/html part found in the message if there is one (or inserted in
front of a </body> tag if any).

If the list has a msg_header or msg_footer, those will still be added to
the message as separate MIME parts (unless the message is simple
text/plain), so you probably want to empty those.

Note that depending on the original HTML, there is no guarantee that
this division will be rendered appropriately at the end of the message
just because it is added at the end of the HTML.

Mark Sapiro <mark at msapiro.net>        The highway is for gamblers,
San Francisco Bay Area, California    better use your sense - B. Dylan

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: Decorate.patch
URL: <http://mail.python.org/pipermail/mailman-developers/attachments/20110719/560f620e/attachment.ksh>

More information about the Mailman-Developers mailing list