# Slack does not recognise email address as an entity

**URL:** <https://forum.rasa.com/t/slack-does-not-recognise-email-address-as-an-entity/13894>\
**Category:** Rasa Open Source\
**Created:** [August 4, 2019, 1:17pm UTC](https://forum.rasa.com/t/slack-does-not-recognise-email-address-as-an-entity/13894 "2019-08-04T13:17:42Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![zain](https://avatars.discourse-cdn.com/v4/letter/z/6a8cbe/32.png) [@zain](https://forum.rasa.com/u/zain)\
**Post date:** [August 4, 2019, 1:17pm UTC](https://forum.rasa.com/t/slack-does-not-recognise-email-address-as-an-entity/13894/1 "2019-08-04T13:17:42Z")

</div>

I want to take email address as input from user. I have tested this feature on rasa shell mode but when i try this in slack it does not work as expected.

here is the chunk of debugging where i take email address as input from user:

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/rasa/original/2X/6/68ea7583b172f2b3dabcf3858ae520511c912991.png)

My observation is that when i input email address in slack so it detects it as ‘[mailto:zainrajani93@gmail.com|zainrajani93](mailto:zainrajani93@gmail.com%7Czainrajani93)@gmail.com’ but in shell mode it just picks the raw text. I can’t resolve this issue in slack. I have searched for the documentation on slack website and tried to change slack.py function as per the documentation:

```
async def send_text_message(
    self, recipient_id: Text, text: Text, **kwargs: Any
) -> None:
    recipient = self.slack_channel or recipient_id
    for message_part in text.split("\n\n"):
        super(SlackBot, self).api_call(
            "chat.postMessage",
            channel=recipient,
            as_user=True,
            text=message_part,
            type="mrkdwn",
        )

```

to

```
async def send_text_message(
    self, recipient_id: Text, text: Text, **kwargs: Any
) -> None:
    recipient = self.slack_channel or recipient_id
    for message_part in text.split("\n\n"):
        super(SlackBot, self).api_call(
            "chat.postMessage",
            channel=recipient,
            as_user=True,
            text=message_part,
            type="plain_text"
        )

```

still the problem is not resolved

I just need to figure out a way to detect input text as raw text without any formatting in slack

Need help on this issue asap

---

<div class="post-metadata">

**Author:** ![imLew](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/imlew/32/3744_2.png) [@imLew](https://forum.rasa.com/u/imLew)\
**Post date:** [August 6, 2019, 3:53pm UTC](https://forum.rasa.com/t/slack-does-not-recognise-email-address-as-an-entity/13894/2 "2019-08-06T15:53:49Z")

</div>

How are you extracting the email when using shell? Maybe you extend it with a regex that covers MD as well as plaintext

---

<div class="post-metadata">

**Author:** ![zain](https://avatars.discourse-cdn.com/v4/letter/z/6a8cbe/32.png) [@zain](https://forum.rasa.com/u/zain)\
**Post date:** [August 7, 2019, 5:59am UTC](https://forum.rasa.com/t/slack-does-not-recognise-email-address-as-an-entity/13894/3 "2019-08-07T05:59:28Z")

</div>

I didn’t change anything in shell mode, its the same way. Slack recognizes it as email address and formats it as [mailto:email|email](mailto:email%7Cemail), while shell mode parses the raw text.

Can you elaborate on regex part?

---

<div class="post-metadata">

**Author:** ![imLew](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/imlew/32/3744_2.png) [@imLew](https://forum.rasa.com/u/imLew)\
**Post date:** [August 7, 2019, 8:46am UTC](https://forum.rasa.com/t/slack-does-not-recognise-email-address-as-an-entity/13894/4 "2019-08-07T08:46:09Z")

</div>

I mean [this](https://rasa.com/docs/rasa/nlu/entity-extraction/#regular-expressions-regex), you can use regular expressions to help the entity extractor. Basically you can add something like `(?:mailto:(?:\w+@\w+\.\w+)\|)?(?:\w+@\w+\.\w+)` to you training data which would match both `mail@something.com` as well as `mailto:mail@something.com|mail@something.com`. (This is probably not the perfect regex for the job but you get the idea).
