:foo expands to
Dear [name], thank you for buying our stuff. We like you, [name]!
Then, when you type ":foo", it prompts you for "name" and fills out the template with "name" inserted everywhere it's mentioned. This is enormously useful for form letter types of things, or even more esoteric uses like expanding HTML tags ("<[tag]>[content]</[tag]>").Prompt For User Input [1] is the easiest method and allows you to build a form fully within the KM's GUI.
Custom HTML Prompt [2] lets you make a full HTML/CSS/JS form. I have never had need of this, but in principle you can leverage any web browser tools such as jQuery and Bootstrap to make a complex form.
Check out the KM forums for examples. KM also allows you to fully integrate AppleScript and shell scripts, so you could do all sorts of other crazy workflows.
[1] https://wiki.keyboardmaestro.com/action/Prompt_for_User_Inpu...
[2] https://wiki.keyboardmaestro.com/action/Custom_HTML_Prompt
The macro: http://imgur.com/1oIhtJm.png
The prompt: https://imgur.com/esJt4gM.png
Keyboard Maestro macros consist of a trigger and an action. In the above example, I used the Typed String trigger to detect when "hhi" is typed then execute an action to create a prompt and paste the text with content from that prompt.
I use it for as much friviolous stuff as serious things (http://i.imgur.com/YgE82eP.png) - having never used TextExpander, I've not had any problems with the text replacements. It's possible to open dialogs and very quickly make UIs too for more involved stuff.