diff --git a/pybossa/emailsvc.py b/pybossa/emailsvc.py index 923489ae4..0a32249e8 100644 --- a/pybossa/emailsvc.py +++ b/pybossa/emailsvc.py @@ -47,7 +47,8 @@ def send(self, message): self.request_type: { "recipients": message["recipients"], "subject": message["subject"], - "body": message["body"] + "body": message["body"], + "bcc": message.get("bcc", []) } } response = requests.post(self.url, headers=self.headers, json=payload, verify=self.ssl_cert) diff --git a/test/test_emailsvc.py b/test/test_emailsvc.py index 9ce842b7e..5a992549f 100644 --- a/test/test_emailsvc.py +++ b/test/test_emailsvc.py @@ -65,7 +65,7 @@ def test_emailsvc_send_email(self, sendmail): with patch.dict(self.flask_app.config, {"PROXY_SERVICE_CONFIG": self.service_config, "SSL_CERT_PATH": cert_path}): esvc = EmailService(self.flask_app) - message = {"recipients": ["abc@def.com"], "subject": "Welcome", "body": "Greetings from xyz"} + message = {"recipients": ["abc@def.com"], "subject": "Welcome", "body": "Greetings from xyz", "bcc": []} expected_svc_payload = { self.service_config["email_service"]["requests"][0]: message }