I'm not sure if this is related to recent changes on Electron 38 or 39, but it seems that the snap build is not keeping the default value mentioned in https://www.electron.build/app-builder-lib.interface.snapoptions#environment
The default value should be {"TMPDIR: "$XDG_RUNTIME_DIR"}, but I needed to add it manually in my package.json in my latest version for the Tray Icon to work in my snap build.
julian-alarcon/prospect-mail@e7db51c
The documentation talking about it is here:
https://www.electronjs.org/docs/latest/tutorial/snapcraft
$XDG_RUNTIME_DIR points to a directory where temporary files can be created (source).