See SYNOPSIS in Mail::Reporter
THIS MODULE IS UNDER CONSTRUCTION. However, a lot of things already work. Best take a look at the examples directory.
See DESCRIPTION in Mail::Reporter
You can specify the following settings in HTML::FromMail::new(settings)
for topic message
:
Message parts have to be displayed. There are a few ways to do that: by
inline
, attach
, and preview
. In the first case, the text of the
part is inserted in the main page, in the other two as link to an external
file. The latter is creating a small preview of the attachement.
The message may provide an indication of the way the part should be
displayed in the Content-Disposition
field. For many reasons, an
exception will be made... for instance, binary messages will never be
inlined. You can create your own code reference to change the behavior
of the default algorithm.
my $f = HTML::FromMail->new ( settings => { message => { disposition => \&my_disposer } } ); sub my_disposer($$$$$) { my ($obj, $message, $part, $suggestion, $args) = @_; return 'attach' if $suggestion eq 'inline' && $part->size > 10_000; $suggestion; }
For some kinds of message parts, previews can be produced. This ordered
list of PAIRS contains mime type with code reference combinations, each
describing such a production. The specified items are added before the
default list of preview generators. An undef
as code reference will
cause the default preview producer to be disabled.
Method previewer() is called when a previewer for a certain content type has to be looked-up. The default previewers are defined (and implemented) in HTML::FromMail::Default::Previewers.
Some kinds of information can be translated into HTML. When a data
type defines such a translation, it may be inlined (see htmlInline()),
where in other cases it will get attached. The usage is the same as
for the previewers
option.
Method htmlifier() is called when a htmlifier for a certain content type has to be looked-up. The default htmlifiers are defined (and implemented) in HTML::FromMail::Default::HTMLifiers.
my @prevs = ( 'text/postscript' => \&prepost , 'image' => \&imagemagick ); my @html = ( 'text/html' => \&strip_html , 'text/plain' => \&plain2html ); my $f = HTML::FromMail->new ( settings => { message => { previewers => \@prevs , htmlifiers => \@html , disposition => \&my_disposer } } ); sub prepost($$$$$) { my ($page, $message, $part, $attach, $args) = @_; # args contains extra info from template # returns a hash of info which is used in a # preview block (see htmlPreview()) }