Template based text with variable values
I am working on a personal project which in short helps self-employed individuals. One of the key features I'm working on is contract creation. The audience I am targeting will most of the time use the same template for the contracts they send to their clients, while usually the only details they change can for instance be dates, names, locations etc. For that, I thought of letting them create "contract templates".
An example template will look something like that (variables are green):
I plan to supply some "generic" variables which I will automatically derive based on available information I have. Although, I would like to give the users an option to add their own variables. I expect that they won't spend too much time in that section and that most of them will simply use the generic automatic variables, but still I think it's reasonable enough to give them the option. They will be able to create contract-templates and contract variables and give them optional values that will be used in the actual contract creation.
Now, assuming they're happy with their templates and variables, my question is: what could be a good UX for creating an actual contract? I mean - how can I make the users select values for the non-generic variables?
For instance, let's say that the user usually gives a bonus service for his clients, but picks a different bonus for different clients, and he wants to have this bonus service listed in the contract.So he can create a non-generic variable named BONUS and add it to the template in some section. Now the user has a new client and he wants to send him a contract, so he uses the template he made before, but I do not have any information about the BONUS variable besides the optional values. What would be a good way to make the user choose values for this BONUS variable and for the other non-generics?
Hope I was clear, it was hard to put in my thoughts into text I admit.
Thanks!