aboutsummaryrefslogtreecommitdiff
path: root/lib/Sietima/Role/ReplyTo.pm
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Sietima/Role/ReplyTo.pm')
-rw-r--r--lib/Sietima/Role/ReplyTo.pm50
1 files changed, 50 insertions, 0 deletions
diff --git a/lib/Sietima/Role/ReplyTo.pm b/lib/Sietima/Role/ReplyTo.pm
index 583b1de..5962451 100644
--- a/lib/Sietima/Role/ReplyTo.pm
+++ b/lib/Sietima/Role/ReplyTo.pm
@@ -6,12 +6,62 @@ use Sietima::Types qw(Address AddressFromStr);
use List::AllUtils qw(part);
use namespace::clean;
+=head1 NAME
+
+Sietima::Role::ReplyTo - munge the C<Reply-To> header
+
+=head1 SYNOPSIS
+
+ my $sietima = Sietima->with_traits('ReplyTo')->new({
+ %args,
+ return_path => 'list-bounce@example.com',
+ munge_reply_to => 1,
+ post_address => 'list@example.com',
+ subscribers => [
+ { primary => 'special@example.com', prefs => { munge_reply_to => 0 } },
+ @other_subscribers,
+ ],
+ });
+
+=head1 DESCRIPTION
+
+A L<< C<Sietima> >> list with this role applied will, on request, set
+the C<Reply-To:> header to the value of the L<< /C<post_address> >>
+attribute.
+
+This behaviour can be selected both at the list level (with the L<<
+/C<munge_reply_to> >> attribute) and at the subscriber level (with the
+C<munge_reply_to> preference). By default, the C<Reply-To:> header is
+not touched.
+
+=head1 ATTRIBUTES
+
+=head2 C<munge_reply_to>
+
+Optional boolean, defaults to false. If set to a true value, all
+messages will have their C<Reply-To:> header set to the value of the
+L<< /C<post_address> >> attribute. This setting can be overridden by
+individual subscribers with the C<munge_reply_to> preference.
+
+=cut
+
has munge_reply_to => (
is => 'ro',
isa => Bool,
default => 0,
);
+=head2 C<post_address>
+
+An L<< C<Email::Address> >> object, defaults to the value of the L<<
+C<return_path>|Sietima/return_path >> attribute. This is the address
+that the mailing list receives messages at.
+
+This role extends the L<< C<list_addresses>|Sietima/list_addresses >>
+method to include this address.
+
+=cut
+
has post_address => (
is => 'lazy',
isa => Address,