Differences between revisions 1 and 5 (spanning 4 versions)
Revision 1 as of 2008-07-31 13:52:41
Size: 3476
Editor: dunxd
Comment:
Revision 5 as of 2011-10-02 19:36:10
Size: 3722
Editor: msapiro
Comment: Added note about cronpass.txt
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
#pragma page-filename DOC/versions/5865509 #pragma page-filename DOC/versions/13304073
Line 3: Line 3:
Richard Barrett has answered this question in two excellent messages on the mailman-users mailing list. See <[[http://mail.python.org/pipermail/mailman-users/2004-June/037497.html&gt]]; and <[[http://mail.python.org/pipermail/mailman-users/2004-June/037650.html&gt]];. Richard Barrett has answered this question in two excellent messages on the mailman-users mailing list. See [[http://mail.python.org/pipermail/mailman-users/2004-June/037497.html]] and [[http://mail.python.org/pipermail/mailman-users/2004-June/037650.html]].
Line 7: Line 7:
If you change templates or add new per-list templates, for instance, you have to run "/usr/local/mailman/bin/mailmanctl restart" to get the qrunner to restart so that it will rebuild its template cache and in the process pick up new or changed templates. The archiver maintains a template cache, so if you create edited versions of any archive related templates, you need to restart Mailman to get the qrunner to restart so that it will rebuild its template cache and in the process pick up new or changed templates.

Non-archive related templates are not cached so any edits or new domain or list specific templates will be effective immediately without a restart.
Line 25: Line 27:
     # lists/&lt;listname&gt;/&lt;language&gt;      # lists/<listname>/<language>
Line 28: Line 30:
     # templates/&lt;list.host_name&gt;/&lt;language&gt;      # templates/<list.host_name>/<language>
Line 31: Line 33:
     # templates/site/&lt;language&gt;      # templates/site/<language>
Line 34: Line 36:
     # templates/&lt;language&gt;      # templates/<language>
Line 39: Line 41:
     # files in the templates/&lt;language&gt; subdirectory, since Mailman will      # files in the templates/<language> subdirectory, since Mailman will
Line 46: Line 48:
     # substituting lang for &lt;language&gt;. If no match is found, and mlist is      # substituting lang for <language>. If no match is found, and mlist is
Line 49: Line 51:
     # &lt;language&gt;. If that still doesn't yield a template, then the standard      # <language>. If that still doesn't yield a template, then the standard
Line 54: Line 56:
In <[[http://mail.python.org/pipermail/mailman-users/2004-October/040452.html&gt]];, Mark Sapiro notes: In [[http://mail.python.org/pipermail/mailman-users/2004-October/040452.html]], Mark Sapiro notes:
Line 66: Line 68:
''Last changed on Sat Nov 25 02:48:02 2006 by'' Mark Sapiro
{{{#!wiki caution
The monthly password reminder template is cronpass.txt, and it is sent without a list context so a list specific version of this template will not work, even if the list is the site list.
}}}

4.48. How can I change the HTML (or .txt) templates used by my mailing lists?

Richard Barrett has answered this question in two excellent messages on the mailman-users mailing list. See http://mail.python.org/pipermail/mailman-users/2004-June/037497.html and http://mail.python.org/pipermail/mailman-users/2004-June/037650.html.

Summarizing from these messages:

The archiver maintains a template cache, so if you create edited versions of any archive related templates, you need to restart Mailman to get the qrunner to restart so that it will rebuild its template cache and in the process pick up new or changed templates.

Non-archive related templates are not cached so any edits or new domain or list specific templates will be effective immediately without a restart.

Note that /bin/arch always starts with its own empty template cache each time it runs.

Also:

You should put your site and list specific changes as described in these comments form $prefix/Mailman/Utils.py:

     # Make some text from a template file.  The order of searches depends on
     # whether mlist and lang are provided.  Once the templatefile is found,
     # string substitution is performed by interpolation in `dict'.  If `raw'
     # is false, the resulting text is wrapped/filled by calling wrap().
     #
     # When looking for a template in a specific language, there are 4 places
     # that are searched, in this order:
     #
     # 1. the list-specific language directory
     #    lists/<listname>/<language>
     #
     # 2. the domain-specific language directory
     #    templates/<list.host_name>/<language>
     #
     # 3. the site-wide language directory
     #    templates/site/<language>
     #
     # 4. the global default language directory
     #    templates/<language>
     #
     # The first match found stops the search.  In this way, you can specialize
     # templates at the desired level, or, if you use only the default
     # templates, you don't need to change anything.  You should never modify
     # files in the templates/<language> subdirectory, since Mailman will
     # overwrite these when you upgrade.  That's what the templates/site
     # language directories are for.
     #
     # A further complication is that the language to search for is determined
     # by both the `lang' and `mlist' arguments.  The search order there is
     # that if lang is given, then the 4 locations above are searched,
     # substituting lang for <language>.  If no match is found, and mlist is
     # given, then the 4 locations are searched using the list's preferred
     # language.  After that, the server default language is used for
     # <language>.  If that still doesn't yield a template, then the standard
     # distribution's English language template is used as an ultimate
     # fallback.  If that's missing you've got big problems. ;)

In http://mail.python.org/pipermail/mailman-users/2004-October/040452.html, Mark Sapiro notes:

 If you want the "Subscribe results page" it is subscribe.html and
 it can also be edited via the lists "Edit the public HTML pages" link.

 If you want the e-mail welcome message, it's subscribeack.txt.

The monthly password reminder template is cronpass.txt, and it is sent without a list context so a list specific version of this template will not work, even if the list is the site list.

Converted from the Mailman FAQ Wizard

This is one of many Frequently Asked Questions.


Comments

S Page

Is it possible to change a message display template so that its <pre> tag has the CSS white-space property that makes long lines wrap to fit the browser window in all modern browsers?!  I filed bug 2074453 on this issue and http://www.skierpage.com/moz_bugs/pre_wrap_test.html has the modified HTML.

(I'm just a Mailman reader.)

Mark Sapiro

A fix has been committed on the 2.2 branch as noted at https://bugs.launchpad.net/mailman/+bug/266467. As a list member, all you can do is ask the Mailman site admins at the sites that host the lists you read to modify the article.html template with the mods indicated in the bug report, place the modified template(s) in templates/site/<language>/article.html and restart Mailman.

Update: As of Mailman 2.1.13, this is in the standard distribution.

MailmanWiki: DOC/4.48 How can I change the HTML or .txt templates used by my mailing lists? (last edited 2016-07-31 05:02:47 by msapiro)