NAME
Template::Plugin::Mariachi - gussy up email for the Mariachi mailing list archiver
SYNOPSIS
[% USE Mariachi %]
<b>From:</b> [% message.from | mariachi(uris => 0) %]<br />
<b>Subject:</b> [% message.subject | html | mariachi %]<br />
<b>Date:</b> [% date.format(message.epoch_date) %]<br />
<pre>[% message.body | html | mariachi %]</pre>
DESCRIPTION
Used by the mariachi mailing list archiver to make emails more suitable for display as html by hiding email addresses and turning bare urls into links.
Theoretically this could be done with some other Template::Toolkit
plugins but this is easier for us.
METHODS
[% USE Mariachi %]
Initialise the Mariahci filter in your template. Can take options like so:
[% USE Mariachi( uris => 0, email => 1) %]
which, in this case, turns off uri munging and turns on email munging.
Both options are on by default.
[% FILTER mariachi %]
[% somevar | mariachi %]
Filter some text. Can take options in a similar manner to initialisation.
[% FILTER mariachi(email => 0) %]
[% somevar | mariachi(uris => 0) %]
munge_quoting <text_ref>
Takes a reference to some text and returns it munged for quoting
munge_email <email> <orig_email>
Takes exactly the same options as callbacks to Email::Find
. Currently turns all non period characters in the domain part of an email address and turns them into 'x's such that :
simon@thegestalt.org
becomes
simon@xxxxxxxxxx.xxx
Should be overridden if you want different behaviour.
munge_uri <uri> <orig_uri>
Takes exactly the same options as callbacks to URI::Find
although it actually uses URI::Find::Schemeless::Stricter
.
As such you should be wary if overriding that the uri may not have a scheme. This
$uri->scheme('http') unless defined $uri->scheme;
solves that particular problem (for various values of solve)
Currently just turns uris into simple clickable links
www.foo.com
becomes
<a href="http://www.foo.com">www.foo.com</a>
Should be overridden if you want different behaviour.
TODO
Strip html out of html mails?
Defang javascript and display html in line?
COPYING
Copyright 2003, the Siesta Development Team