mattermost-plugin-user-survey

module
v1.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 22, 2024 License: Apache-2.0

README

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

Technical Architecture

The tech docs are located here.

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.

Building in Dev Mode

Set the following environment variables to true before running make dist-

  1. MM_SERVICESETTINGS_ENABLEDEVELOPER
  2. MM_DEBUG

This will generate a development built for your OS and architecture. If you want to generate dev builds for other architectures, use the command make dist-debug after setting up the above mentioned env variables.

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

How to Release

To trigger a release, follow these steps:

  1. For Patch Release: Run the following command:

    make patch
    

    This will release a patch change.

  2. For Minor Release: Run the following command:

    make minor
    

    This will release a minor change.

  3. For Major Release: Run the following command:

    make major
    

    This will release a major change.

  4. For Patch Release Candidate (RC): Run the following command:

    make patch-rc
    

    This will release a patch release candidate.

  5. For Minor Release Candidate (RC): Run the following command:

    make minor-rc
    

    This will release a minor release candidate.

  6. For Major Release Candidate (RC): Run the following command:

    make major-rc
    

    This will release a major release candidate.

Directories

Path Synopsis
build
pluginctl
main handles deployment of the plugin to a development server using the Client4 API.
main handles deployment of the plugin to a development server using the Client4 API.
api
app

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL