def failures_message(failed):
    """Format a list of failed recipes for a slack message"""
    failures_msg = 	[            
        {
            "color": '#f2c744', "blocks": [
                {
                    "type": "divider"
                },
                {
                    "type": "section", "text": {"type": "mrkdwn", "text": ":warning: *The following recipes failed*"}
                }
            ]
        }
    ]
    for item in failed:
        info = item["message"]
        name = item["recipe"]
        failure_info = [
            {
                "type": "section", "text": {"type": "mrkdwn", "text": f"{name}"}
            },
            {					
                "type": "section", "text": {"type": "mrkdwn", "text": f"```{info}```"}
            }
        ]
        failures_msg[0]['blocks'].extend(failure_info)
    return failures_msg