creates a function to send each defined message type