Repository: scrapinghub/spidermon

Issue:
It's not possible to specify SPIDERMON_SLACK_RECIPIENTS via Scrapy Cloud
We should replace `settings.get` by `settings.getlist`. I'm working on a pull request. 

Discussion:
victor-torres: cc @ejulio 
victor-torres: Thank you for your suggestions, @rennerocha. I've just pushed a couple of commits that should have addressed them. Let me know if I can help with anything else.

Patch:
diff --git a/spidermon/contrib/actions/slack/__init__.py b/spidermon/contrib/actions/slack/__init__.py
index 8674c0e..0de8dd4 100644
--- a/spidermon/contrib/actions/slack/__init__.py
+++ b/spidermon/contrib/actions/slack/__init__.py
@@ -194,7 +194,7 @@ class SendSlackMessage(ActionWithTemplates):
         return {
             "sender_token": crawler.settings.get("SPIDERMON_SLACK_SENDER_TOKEN"),
             "sender_name": crawler.settings.get("SPIDERMON_SLACK_SENDER_NAME"),
-            "recipients": crawler.settings.get("SPIDERMON_SLACK_RECIPIENTS"),
+            "recipients": crawler.settings.getlist("SPIDERMON_SLACK_RECIPIENTS"),
             "message": crawler.settings.get("SPIDERMON_SLACK_MESSAGE"),
             "message_template": crawler.settings.get(
                 "SPIDERMON_SLACK_MESSAGE_TEMPLATE"


Test patch:
diff --git a/tests/contrib/actions/slack/test_slack_message_manager.py b/tests/contrib/actions/slack/test_slack_message_manager.py
index 1035957..63ee934 100644
--- a/tests/contrib/actions/slack/test_slack_message_manager.py
+++ b/tests/contrib/actions/slack/test_slack_message_manager.py
@@ -1,5 +1,11 @@
 import pytest
-from spidermon.contrib.actions.slack import SlackMessageManager
+
+from scrapy.utils.test import get_crawler
+
+from spidermon.contrib.actions.slack import (
+    SlackMessageManager,
+    SendSlackMessage,
+)
 
 
 @pytest.fixture
@@ -39,3 +45,13 @@ def test_api_call_with_error_should_log_error_msg(mocker, logger_error):
 
     assert logger_error.call_count == 1
     assert error_msg in logger_error.call_args_list[0][0]
+
+
+@pytest.mark.parametrize("recipients", ["foo,bar", ["foo", "bar"]])
+def test_load_recipients_list_from_crawler_settings(recipients):
+    settings = {
+        "SPIDERMON_SLACK_RECIPIENTS": recipients,
+    }
+    crawler = get_crawler(settings_dict=settings)
+    kwargs = SendSlackMessage.from_crawler_kwargs(crawler)
+    assert kwargs["recipients"] == ["foo", "bar"]