Triggers & Notifications

User @mention Notification

Forward @username mentions to another channel
Back to BLOCKS

About User @mention Notification

Ever get pinged because your @username was mentioned in a chat room? This block will get you started with that same flow.

It parses all messages that travel through the channel. If that message has a @username mention in it, it forwards the message to the @username channel.

Try it Now
Categories:
Triggers & Notifications Triggers & Notifications
Chat & Social
Chat & Social
Triggers & Notifications
Triggers & Notifications
Last Updated:
20160801 at 17:46:09
Author:
Ian Jennings

Walkthrough

Any message sent over your channel will be parsed for the @username using a regular expression. If @username is detected, the same message is forwarded to the @username channel. The original message still reaches the intended target.

In production every user should have their own @username channel that is locked down with PubNub PAM so only they can access it.

Input

A message is published on the input channel: user-mention-channel
    "A message that mentions a @username"

Output

Note that the message is identical, but the new message has been duplicated and sent to a channel called @username.
    "A message that mentions a @username"