In the configuration menu add switches on those gpios. Ensure you use a switch_nX variant. You should add pull down resistors on each pin. 10k should be fine.
In the console decouple the switches from the relay with so73 1
Now create a rule. Assume switch 3 is on gpio14.
Rule1 on switch3#state=1 do backlog0 publish sometopic on; ruletimer3 8 Endon on rules#timer=3 do publish sometopic off Endon
Not really sure what you mean by send an Mqtt message for 8 seconds. These things are asynchronous. I have assumed you want to send an off message after 8 seconds.
Replace sometopic with the full topic you wish to use.
If you really need the web UI to display on or off then you also should consider a synthetic relay for each switch. Add them in the configuration menu to unused gpios.
Change the rule to be
Rule1 on switch3#state=1 do backlog0 publish sometopic on; ruletimer3 8, power3 1 Endon on rules#timer=3 do backlog0 publish sometopic off; power3 0 Endon
Use webbuttonX to change the text for the relay. E.g. in console: webbutton3 GPIO14