What I want to do is that when someone has ran a command, a tellraw text runs a command and when you press it, you can type a message to one particular person, who's offline on the server you're on.
When you have finished typing the message, the command block will activate and will tell you this message: "Mail send!".
When the receiver of your message comes online, they will get a tellraw message with a run_command saying: "You received 1 mail!", and when they click on the message it will show the message you typed for him/her.
But I don't know how to do this, I know how to do some stuff, but I don't know how to make it detect for a player when he/she says something in the chat.