does anybody of you know about a good way of building string templates, that can be filled with corresponding data afterwords? It's for a communication system.
So a desired output could look like:
Hello Batman, how are you doing? Your friends Superman, Catwoman and Spiderman are already using our service. Would you like to give our service a try?
The actual data should be pulled from the database and so there needs to be a general way of processing something like this:
Hello {Username}, how are you doing? {If:HasFriendsWhoUseTheService}Your friends {ListFriends} are already using our service.{EndIf} Would you like to give our service a try?
So that means in case the user doesn't have friends who are using the system, the middle sentence shouldn't be printed.
I've just built a small system that is capable of replacing fields like {username} or {ListFriends} appropriately, but then I recognized, that there also should be some if statements.
Does anybody know a library or something similar that supports such stuff? Maybe there is also more to consider, for a maximum of flexibility.