Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support multiple email recipients #113

Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion spark_expectations/notifications/plugins/email.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,9 @@ def send_notification(
)
server.starttls()
text = msg.as_string()
server.sendmail(_context.get_mail_from, _context.get_to_mail, text)
server.sendmail(
_context.get_mail_from, _context.get_to_mail.split(","), text
asingamaneni marked this conversation as resolved.
Show resolved Hide resolved
)
server.quit()

_log.info("email send successfully")
Expand Down
2 changes: 1 addition & 1 deletion tests/notification/plugins/test_email.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def test_send_notification_success(_mock_context):
# assert
mock_smtp.assert_called_with(_mock_context.get_mail_smtp_server, _mock_context.get_mail_smtp_port)
mock_smtp().starttls.assert_called()
mock_smtp().sendmail.assert_called_with(_mock_context.get_mail_from, _mock_context.get_to_mail,
mock_smtp().sendmail.assert_called_with(_mock_context.get_mail_from, _mock_context.get_to_mail.split(","),
_mock_mltp().as_string())
mock_smtp().quit.assert_called()

Expand Down