NAME
Email::Sender::Transport::Redirect::Recipients - handle email address redirect replacements
SYNOPSIS
This is a class used internally by Email::Sender::Transport::Redirect and shouldn't be used directly.
my $rec = Email::Sender::Transport::Redirect::Recipients->new($string_or_hashref);
print $rec->to;
print Dumper($rec->exclude);
print $rec->replace('myemail@example');
CONSTRUCTOR
BUILDARGS
new($string_or_hashref)
Either a single email as string, or an hashref which are used to initialize the accessors (see above). If a string is provided, then just to
will be set and no exclusions are set.
ACCESSORS
to
The main, required email address to use as a redirect.
exclude
An arrayref of emails or wildcard expressions. E.g.
[ 'mail@example.org', '*@example.org', 'racke@*' ]
These emails will not get redirected.
METHODS
replace($string)
Main method. When a string is passed, it's checked against the exclusion list. If there is a match, the address passed as argument will be returned, otherwise the to
address set in the object will be returned.