Customization and channel inclusion of team invites

Hi daddo,

let me try to answer your questions.

ad 1)
You can customize the file invite_body.html in your Mattermost server’s template directory to your needs. It also includes the following code which suggests that while you cannot change the picture itself, you can point to some other picture that better suits your needs:

<img alt height="auto" src="{{.Props.SiteURL}}/static/images/invite_illustration.png" style="border:0;display:block;outline:none;text-decoration:none;height:auto;width:100%;font-size:13px;" width="246">

If you have a reverse proxy in front of your Mattermost installation, you could also just override the path to this PNG and deliver your own picture (if the sizes match).

ad 2)
Not in the GUI, as far as I know.
All the invite tokens are stored in the database, though, here’s an example from one of my test installations:

mm751=# select * from tokens;
                              token                               |   createat    |      type       |                                    extra
 pxhzn9oqdtkon3widx94npaoc333ygxc5xuronssftoesq35efkkg9u841nt61bn | 1673329170907 | team_invitation | {"email":"","teamId":"pgm7bu7rx7rfzby1rka3yiccar"}
(1 row)

I don’t think that Mattermost sends invitation reminders, but I could be wrong about that. E-Mail invitations also expire after 48hrs, JFTR.

ad 3)
No, the users are not created at this point in time (not part of the users table). If you want to preseed the accounts, you might want to look at using tools like mmctl in order to precreate the users and also add them to channels at the same time.
I’ve written a short script for someone on the community server who had a similar question, I’ll post it here so you can see what the idea behind this approach is:


# space separated list of channels to add for each user
CHANNELS="channel1 channel2 channel3"
# team to add the users to
# the maildomain added to the username
# mmctl command
MMCTL="mmctl --local"
# password to be used for all accounts. Leave empty and set PWLEN > 0 if you want passwords to be auto-generated
# set to empty string if you want to actually run the commands, set to "echo" if you just want to see what woule be done

# first parameter of the script will be the file to read the input data from
# if no parameter is given or if the file cannot be found, fail
if [ -z "$1" ] || ! [ -f "$1" ]; then
  echo "input file $1 not found."
  exit 1

while read line; do
  # split the input line by space into parts
  IFS=" " read -r -a PARTS <<< "$line"
  # generate random password if requested
  [ "$PWLEN" -gt "0" ] && PASSWORD=$(makepasswd --chars=$PWLEN)
  # create the user account
  $DEBUG $MMCTL user create --email "${PARTS[0]}@$MAILDOMAIN" --email-verified --firstname ${PARTS[1]} --lastname ${PARTS[2]} --locale en --password $PASSWORD --username ${PARTS[0]}
  # add it to all mentioned channels
  for channel in $CHANNELS; do
    $DEBUG $MMCTL channel users add $TEAM:$channel ${PARTS[0]}
  # output user + password for copy/pasting it to the users
  echo "${PARTS[0]} / $PASSWORD"
done < "$1"

ad 4)
There’s a config option for that in your config.json, it’s marked as experimental and that’s also what it is. As of yet, I’ve not managed to make it work in my installations, but YMMV.

    "TeamSettings": {
        "ExperimentalDefaultChannels": []

Check out the following form thread for the syntax and an alternative to it (the welcomebot):