aboutsummaryrefslogtreecommitdiff
path: root/lib/Sietima/Role/NoMail.pm
diff options
context:
space:
mode:
authordakkar <dakkar@thenautilus.net>2017-03-24 17:57:04 +0000
committerdakkar <dakkar@thenautilus.net>2017-03-24 17:57:04 +0000
commitb2074b822e39b09bcc0b44ce77b8ceab21e52069 (patch)
tree800182ec459b5efbd2a0b190727ef05c1922e8c5 /lib/Sietima/Role/NoMail.pm
parentv1.0.1 (diff)
parentDzil-build release 1.0.0 (from 9f1fc6d on master) (diff)
downloadSietima-b2074b822e39b09bcc0b44ce77b8ceab21e52069.tar.gz
Sietima-b2074b822e39b09bcc0b44ce77b8ceab21e52069.tar.bz2
Sietima-b2074b822e39b09bcc0b44ce77b8ceab21e52069.zip
Dzil-build release 1.0.1 (from 5ab528e on master)v1.0.1
Diffstat (limited to 'lib/Sietima/Role/NoMail.pm')
-rw-r--r--lib/Sietima/Role/NoMail.pm48
1 files changed, 38 insertions, 10 deletions
diff --git a/lib/Sietima/Role/NoMail.pm b/lib/Sietima/Role/NoMail.pm
index 10071d6..cd1fc30 100644
--- a/lib/Sietima/Role/NoMail.pm
+++ b/lib/Sietima/Role/NoMail.pm
@@ -3,9 +3,33 @@ use Moo::Role;
use Sietima::Policy;
use namespace::clean;
-# VERSION
+our $VERSION = '1.0.1'; # VERSION
# ABSTRACT: don't send mail to those who don't want it
+
+around subscribers_to_send_to => sub ($orig,$self,$mail) {
+ return [
+ grep { $_->prefs->{wants_mail} // 1 }
+ $self->$orig($mail)->@*,
+ ];
+};
+
+1;
+
+__END__
+
+=pod
+
+=encoding UTF-8
+
+=head1 NAME
+
+Sietima::Role::NoMail - don't send mail to those who don't want it
+
+=head1 VERSION
+
+version 1.0.1
+
=head1 SYNOPSIS
my $sietima = Sietima->with_traits('NoMail')->new({
@@ -22,18 +46,22 @@ A L<< C<Sietima> >> list with this role applied will not send messages
to subscribers that have the C<wants_mail> preference set to a false
value.
-=modif C<subscribers_to_send_to>
+=head1 MODIFIED METHODS
+
+=head2 C<subscribers_to_send_to>
Filters out subscribers that have the C<wants_mail> preference set to
a false value.
-=cut
+=head1 AUTHOR
-around subscribers_to_send_to => sub ($orig,$self,$mail) {
- return [
- grep { $_->prefs->{wants_mail} // 1 }
- $self->$orig($mail)->@*,
- ];
-};
+Gianni Ceccarelli <dakkar@thenautilus.net>
-1;
+=head1 COPYRIGHT AND LICENSE
+
+This software is copyright (c) 2017 by Gianni Ceccarelli <dakkar@thenautilus.net>.
+
+This is free software; you can redistribute it and/or modify it under
+the same terms as the Perl 5 programming language system itself.
+
+=cut