Mattermost User Survey Plugin

A self-hosted plugin for managing surveys withing a Mattermost installation

This plugin allows admins to configure, customize, schedule, and manage surveys for their Mattermost users. All responses are stored within your Mattermost deployment. You can generate a CSV report for a survey to review the feedback received and analyze trends in NPS scores.

Features

  • Admins can schedule surveys to begin on a specific date and a specific time.
  • Admins can configure how long each survey lasts.
  • Members of specific teams can be excluded from a survey.
  • Admins can customize the Welcome message for each survey.
  • Admins can customize one question. Additional question customization is planned in a future iteration.
  • Admins can generate a report for each survey that includes NPS scores and user responses.

user survey demo screenshot

Development

Setup

Make sure you have the following components installed:

You also want to have the environment variable MM_SERVICESETTINGS_ENABLEDEVELOPER="true" set, otherwise the plugin will be compiled for Linux, Windows, and Darwin ARM64 and x64 architecture every single time. Setting the MM_SERVICESETTINGS_ENABLEDEVELOPER to true makes the plugin compile and build only for the OS and architecture you are building on.

In your Mattermost configuration file, ensure that PluginSettings.EnableUploads is set to true, and FileSettings.MaxFileSize is set to a large enough value to accept the plugin bundle (eg 256000000).

Building the plugin

Run the following command in the plugin repository to prepare a compiled, distributable plugin ZIP file:

make dist

After a successful build, a .tar.gz file in the /dist folder will be created which can be uploaded to Mattermost. To avoid having to manually install your plugin, deploy your plugin using one of the following options.

Deploying with Local Mode

If your Mattermost server is running locally, you can enable local mode to streamline deploying your plugin. Edit your server configuration as follows:

{
    "ServiceSettings": {
        ...
        "EnableLocalMode": true,
        "LocalModeSocketLocation": "/var/tmp/mattermost_local.socket"
     }
}

and then deploy your plugin:

make deploy

You may also customize the Unix socket path:

export MM_LOCALSOCKETPATH=/var/tmp/alternate_local.socket
make deploy

If developing a plugin with a web app, watch for changes and deploy those automatically:

export MM_SERVICESETTINGS_SITEURL=http://localhost:8065
export MM_ADMIN_TOKEN=j44acwd8obn78cdcx7koid4jkr
make watch

Deploying with credentials

Alternatively, you can authenticate with the server's API with credentials:

export MM_SERVICESETTINGS_SITEURL=http://localhost:8065
export MM_ADMIN_USERNAME=admin
export MM_ADMIN_PASSWORD=password
make deploy

or with a personal access token:

export MM_SERVICESETTINGS_SITEURL=http://localhost:8065
export MM_ADMIN_TOKEN=j44acwd8obn78cdcx7koid4jkr
make deploy