Skip to content

Commit b8436ed

Browse files
committed
Clean up and docs
1 parent 94af563 commit b8436ed

File tree

1 file changed

+10
-14
lines changed

1 file changed

+10
-14
lines changed

lib/WWW/Mailgun.pm

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -91,16 +91,7 @@ sub send {
9191
$msg->{subject} = $msg->{subject} // "";
9292
$msg->{text} = $msg->{text} // "";
9393

94-
my $content = _prepare_content(
95-
$msg,
96-
attachments => {
97-
send_as => 'attachment',
98-
},
99-
tags => {
100-
send_as => 'o:tag',
101-
max_num => 3,
102-
},
103-
);
94+
my $content = _prepare_content($msg);
10495

10596
my $r = $self->{post}->($self, 'messages', $content);
10697

@@ -109,12 +100,17 @@ sub send {
109100
return from_json($r->decoded_content);
110101
}
111102

112-
=head2 _prepare_content($msg, %msg_key__options) : \@content
103+
=head2 _prepare_content($msg) : \@content
113104
114105
Given a $msg hashref, transform it to an arrayref suitable for sending
115-
as multipart/form-data. By default, keys in $msg are copied to the options
116-
arrayref as is. Array keys need to be transformed in a special way, and you
117-
should define them in %msg_key__options.
106+
as multipart/form-data. The core logic here is that array references are
107+
modified from:
108+
109+
option => [ value1, value2, ... ]
110+
111+
to
112+
113+
[ option => value1, option => value2, ... ]
118114
119115
=cut
120116

0 commit comments

Comments
 (0)