Skip to content

Allow customizing message for Slack notifications #229

Description

@nawatts

slack_notifications uses the process name from sys.argv in notifications.

process = os.path.basename(sys.argv[0])
try:
yield
slack_client = SlackClient(token)
slack_client.send_message(
to, f":white_check_mark: Success! {process} finished!"
)
except Exception as e:
slack_client = SlackClient(token)
slack_client.send_file(
to,
content=traceback.format_exc(),
filename=f"error_{process}_{time.strftime('%Y-%m-%d_%H:%M')}.log",
filetype="text",
comment=f":x: Error in {process}",
)

However, someone may want notifications about multiple blocks in the same script. There should be a way to distinguish those notifications.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions