Email-Sender-Transport-Redirect

 view release on metacpan or  search on metacpan

lib/Email/Sender/Transport/Redirect/Recipients.pm  view on Meta::CPAN


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 C<to> address set in the object will
be returned.

=cut


has to => (is => 'ro', isa => Str, required => 1);
has exclude => (is => 'ro', isa => ArrayRef[Str], default => sub { [] });

sub BUILDARGS {
    my ($class, @args) = @_;
    die "Only one argument is supported!" unless @args == 1;
    my $arg = shift @args;
    if (my $kind = ref($arg)) {
        if ($kind eq 'HASH') {
            my %hash = %$arg;
            foreach my $k (keys %hash) {
                die "Extra argument $k" unless $k eq 'to' || $k eq 'exclude';



( run in 0.722 second using v1.01-cache-2.11-cpan-39bf76dae61 )