소스 검색

This should get it done, I think for #15

Andy Baugh 6 년 전
부모
커밋
ad4fc90b16
1개의 변경된 파일5개의 추가작업 그리고 6개의 파일을 삭제
  1. 5 6
      lib/Cpanel/iContact/Provider/Slack.pm

+ 5 - 6
lib/Cpanel/iContact/Provider/Slack.pm

@@ -68,12 +68,11 @@ sub send {
     my $message = ${ $args_hr->{'text_body'} };
 
     require Cpanel::AdminBin::Serializer;
-    my $message_json = Cpanel::AdminBin::Serializer::Dump(
-        {
-            'text'        => $subject,
-            'attachments' => [ { "text" => $message } ],
-        }
-    );
+    my $dump_hr = {
+        'text'        => $subject,
+    };
+    $dump_hr->{'attachments'} = [ { "text" => $message } ] if $contact_hr->{'SLACKCOMPACT'};
+    my $message_json = Cpanel::AdminBin::Serializer::Dump($dump_hr);
 
     # Send it
     foreach my $destination ( @{ $args_hr->{'to'} } ) {