Message formatting

Last updated:

Message formatting works the same way whether you are using Slack, Microsoft Teams, or Discord.

Tokens are in the format [type.property].

Message format can be customised when editing/creating an Action.

Default

By default, the message format is

[action.name] was triggered by [user.name].

Types

Action

Allowed properties

  • name: name of triggered action with link.

Event

Allowed properties

  • name: name of the event which triggered the Action with link.
Accessing event properties

You can also access any property on the event that triggered the webhook by using event.properties.your_desired_prop.

This can be a property set by PostHog, such as event.properties.ip, and it can also use any custom properties you set, like event.properties.username.

If a property does not exist on the event, the webhook message will say undefined for the property.

For example, the following message format:

[user.name] triggered [action.name] from [event.properties.country]

Would yield the a message like the one below, if the property country is not set on the event:

John Doe triggered Pageview from undefined

User

Allowed properties

  • name: user's username, email, or distinct ID depending on availability.
  • ip: IP address used by user when the action was triggered.
  • os: user's Operating System.
  • browser: user's Web Browser.
  • browser_version: version of user's Web Browser.
  • host: URL of PostHog instance user connected via.
  • time: timestamp of Event.
  • pathname: HREF path Action was triggered on.
  • device_id: ID of user's device.
  • screen_width: width of user's screen.
  • screen_height: height of user's screen.
  • initial_referrer: domain user visited before Event ($direct for direct visits).

Questions?

Was this page useful?

Next article

Microsoft Teams

For message formatting instructions, see this dedicated page . 1. Create an incoming webhook in Teams Navigate to the channel where you want to add the webhook and select (•••) More Options from the top navigation bar. Choose Connectors from the drop-down menu and search for Incoming Webhook. Select the Configure button, provide a name, and, optionally, upload an image avatar for your webhook. The dialog window will present a unique URL that will map to the channel. Make sure that you copy and…

Read next article