def create_pipeline_message_text(channel, pipeline):
    """
    Creates a dict that will be sent to send_message for pipeline success or failures
    """
    emote = ":red_circle:" if pipeline.get("state") == "FAILED" else ":white_check_mark:"
    return {
        "channel": channel,
        "text": (
            f"{emote} Pipeline {pipeline['name']} on {pipeline['account_id']} "
            f"has {pipeline['state']}"
        ),
    }