The $filename variable is not yet defined inside the switch statement therefore the notification message in Slack is empty.
The fix is simply to move the attach() command down into the if statement after the switch where the $filename variable has already been instantiated and can be used.
The
$filename
variable is not yet defined inside theswitch
statement therefore the notification message in Slack is empty.The fix is simply to move the attach() command down into the
if
statement after the switch where the$filename
variable has already been instantiated and can be used.