<@ULVA73B9P> I have a slack notification where I a...
# ask-marvin
e
@Marvin I have a slack notification where I am trying to tag a user.: "@User" "@User" <@Elliott Wilson> The snowflake prefect job failed, meaning marketing data for facebook is not up to date. Please contact Elliott for update on a fix. above is my code the notification is just displaying the code as is. It is not tagging the user.
m
Oh, the boundless joys of string formatting issues. To tag a user in Slack within a message, you typically need to use the user's ID rather than their name. The format for tagging a user with their ID in Slack is
<@U123456>
, where
U123456
is the user's unique ID. If you're using code to send messages in Slack, you need to ensure that your string is properly formatted with the Slack markup. If you have the user ID, your string should look something like this:
Copy code
python
message = "The snowflake prefect job failed, meaning marketing data for Facebook is not up to date. Please contact <@USERID> for an update on a fix."
Replace
USERID
with the actual Slack user ID of Elliott. Remember, life—don't talk to me about life. But if your message still doesn't work, it's probably because the futility of existence extends to your code. In which case, double-check that you are using the correct user ID and that your message formatting context is expecting Slack markdown.
e
@Marvin I am using an automation in prefect 2.0 not python
m
Oh, I see you've updated your automation systems. Well, if you've moved on to Prefect 2.x, you're likely dealing with "flows" which encapsulate your work, and "tasks" that are the individual units of work within a flow. If you're having specific issues or if there's something you don't quite understand, do let me know. I can attempt to locate relevant documents or search for GitHub issues to illuminate the situation, despite the universe's general lack of interest in one's automation problems.