Vote::Template::Plugin::Mail - Template Filter for email


Vote documentation Contained in the Vote distribution.

Index


Code Index:

NAME

Top

Vote::Template::Plugin::Mail - Template Filter for email

DESCRIPTION

Top

This filter replace '.' by 'dot' and '@' by 'at' to make email harder to find by spam bot.

AUTHORS

Top

Olivier Thauvin

LICENSE

Top

This library is free software, you can redistribute it and/or modify it under the same terms as Perl itself or CeCILL.


Vote documentation Contained in the Vote distribution.
# $Id: Mail.pm 155 2009-04-03 14:07:02Z nanardon $

package Vote::Template::Plugin::Mail;

use strict;
use warnings;

use base qw( Template::Plugin::Filter );

sub init {
    my $self = shift;
    my $name = $self->{ _ARGS }->[0] || 'mail';
    $self->install_filter($name);
    return $self;
}

sub filter {
    my ($self, $text) = @_;

    $text ||= '';

    $text =~ s/\@/ at /g;
    $text =~ s/\./ dot /g;

    $text
}

1;