aboutsummaryrefslogtreecommitdiff
path: root/lib/Sietima.pm
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Sietima.pm')
-rw-r--r--lib/Sietima.pm26
1 files changed, 17 insertions, 9 deletions
diff --git a/lib/Sietima.pm b/lib/Sietima.pm
index 9115c05..59fe7bc 100644
--- a/lib/Sietima.pm
+++ b/lib/Sietima.pm
@@ -2,7 +2,7 @@ package Sietima;
use Moo;
use Sietima::Policy;
use Types::Standard qw(ArrayRef Object FileHandle Maybe);
-use Type::Params qw(compile);
+use Type::Params -sigs;
use Sietima::Types qw(Address AddressFromStr
EmailMIME Message
Subscriber SubscriberFromAddress SubscriberFromStr SubscriberFromHashRef
@@ -163,9 +163,11 @@ then sends each of them by calling L<< /C<send_message> >>.
=cut
+signature_for handle_mail => (
+ method => Object,
+ positional => [ EmailMIME ],
+);
sub handle_mail($self,$incoming_mail) {
- state $check = compile(Object,EmailMIME); $check->(@_);
-
my (@outgoing_messages) = $self->munge_mail($incoming_mail);
for my $outgoing_message (@outgoing_messages) {
$self->send_message($outgoing_message);
@@ -187,9 +189,11 @@ some subscribers.
=cut
+signature_for subscribers_to_send_to => (
+ method => Object,
+ positional => [ EmailMIME ],
+);
sub subscribers_to_send_to($self,$incoming_mail) {
- state $check = compile(Object,EmailMIME); $check->(@_);
-
return $self->subscribers;
}
@@ -209,9 +213,11 @@ this method to alter the message.
=cut
+signature_for munge_mail => (
+ method => Object,
+ positional => [ EmailMIME ],
+);
sub munge_mail($self,$incoming_mail) {
- state $check = compile(Object,EmailMIME); $check->(@_);
-
return Sietima::Message->new({
mail => $incoming_mail,
from => $self->return_path,
@@ -229,9 +235,11 @@ L<envelope|Sietima::Message/envelope> specifies some recipients.
=cut
+signature_for send_message => (
+ method => Object,
+ positional => [ Message ],
+);
sub send_message($self,$outgoing_message) {
- state $check = compile(Object,Message); $check->(@_);
-
my $envelope = $outgoing_message->envelope;
if ($envelope->{to} && $envelope->{to}->@*) {
$self->transport->send(