<@U088WCP3B4P> How can I tag a specific user in an...
# ask-elementary-ai
l
@kapa.ai How can I tag a specific user in an alert if there are multiple emails with the same prefix (eg. jessica.jones@private.com and jessica.jones@company.com)? Currently elementary defaults to one of the two when defining “@jessica.jones” as owner.
k
A message from kapa.ai
Based on the knowledge sources, when you have multiple users with the same email prefix in your Slack workspace, you should use the Slack User ID instead of the email prefix to tag a specific user. According to discussions in the [Elementary Slack community](https://slack.com/archives/C02CTC89LAX/p1669647715732819), the recommended format for using Slack User IDs is:
Copy code
yaml models:   - name: my_model_name     meta:       owner: "<@USER_ID>"
For example, if the user ID is
DGN6MQ07L
, you would configure it as:
Copy code
yaml meta:   owner: "<@DGN6MQ07L>"
This format (
<@USER_ID>
) is what [Slack's API documentation recommends](https://slack.com/archives/C02CTC89LAX/p1669647715732819) for mentioning users and ensures you're tagging the exact user you intend to. To find a user's Slack ID, you can use the Slack API method
users_lookupByEmail
. As mentioned in the [community discussion](https://slack.com/archives/C02CTC89LAX/p1669647715732819):
Copy code
python client.users_lookupByEmail(email=email)["user"]["id"]
This approach is particularly important for Slack Enterprise customers or workspaces where multiple users might share the same email prefix but have different email domains, as the email prefix method (
@jessica.jones
) may not reliably distinguish between them.
l
@kapa.ai Would it be possible for Elementary to skip deactivated slack accounts? Right now we always have only one account active with the same email prefix
k
A message from kapa.ai
Based on the knowledge sources, there is a mention of this exact issue in the [Elementary Slack community](https://slack.com/archives/C02CTC89LAX/p1690930833713179). A user reported: > "Let's say our Slack workspace has users with multiple email domains. Employee 1 (jane@company_url.com) left the company and the slack profile is deactivated. Employee 2 (jane@new_company_url.com) is an active employee. When I set
meta: owner: @jane
for a table, it tags the old, deactivated Jane account and not the new one." The user was able to resolve this by using the entire email address instead of the email prefix:
Copy code
yaml meta:   owner: "jane@new_company_url.com"
However, the knowledge sources do not explicitly mention whether Elementary has a built-in feature to automatically skip deactivated Slack accounts when using email prefixes. The workaround provided was to use the full email address to distinguish between the active and deactivated accounts. If you'd like Elementary to add functionality to automatically filter for only active Slack accounts, you could consider opening a feature request on their [GitHub repository](https://github.com/elementary-data/elementary/issues/new?assignees=&amp;labels=Feature+Request+%F0%9F%92%A1%2C+Triage+%F0%9F%91%80&amp;projects=&amp;template=feature_request.md&amp;title=), as suggested by the Elementary team in similar feature discussions.