I am using a change node to produce a long string where several parts need to be replaced by the value of environment variables. See example here below:
This functionally works perfect but the problem is that
it is not very convenient to edit / review such long strings as only a small part is visible in the editor.
moreover the string is actually a multiline string while it is shown as a single line string in the editor which also makes it harder to edit / review.
Template currently only supports the msg along with flow and global vars as you've discovered. The workaround is to use a change node before the template to add the env vars to the msg as new properties.
Alternatively, if the environment vars are actaully set prior to the launch of Node-RED, you can pass them into global vars in settings.js of course. Though that doesn't help with the handy env vars you can set in groups and sub-flows.
Another alternative would be not to use env vars but rather global or flow vars. That would work in some but probably not all situations.
However, I agree that since the use of env vars in Node-RED is steadily expanding, making them available to the template node and possibly JSON as well would be a nice addition.