I don't think it possible using a template. You can rename the file afterwards using dispatch, though.
Not fully resolved but it is a start.
Also look at your card design for the relevant file - because it can pull a variable from the folder it is in. Default value of Folder Data Card Variable.
Just answered it myself. James, you should be able to use the method I outlined there to get the folder name.
We do something similar with every customer. I drive it like this:
Sales puts in the quote info (Customer Prefix [ID], Customer PN, Customer Rev), all of these get driven to a folder/quote variable.
So basically when you create the folder, set the folder name to a variable. On your CAD Model Card, for your CAD PN set the input variable to the folder card variable(s).
In your part template enable the ability to change variables when prompted (show card)
Then you can add a suffix, like TEST, to the part, or totally rename it at that point.
That's a short explanation. Our workflow consists of sales making the project folder which drives everything below it. If you would like a more thorough explanation of how to do it send me an email cschultz(at)danemfg(dot)com
This probably does not relate to your problem, but... We do dot have PDM. (Take it up with my boss, please.) One thing that I've done to our drawing templates is, in the upper left corner, in the sheet format, in small font, is to create a note, linked to SW-FOLDER NAME then linked to SW-FILE NAME. This places the file path and name on the drawing, so that a year after we've modeled and drawn something, we can find our way back to it. It helps me, it may help you. Or not. Whatever.