PubNub Integration

User @mention Notification

In-app chat

In-app chat

Alerts & Notifications

Alerts & Notifications

Last Updated:

2016/08/01

Author:

Ian Jennings

Forward @username mentions to another channel

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.

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"

Feedback & Support

Need help? Contact PubNub Support.


Talk to an expert

Contact Sales