The sentence
You will know what to do after reading my name in this message.
is perfectly valid. The gerund form ("reading" ) used here indicates a process or action, but it may be a very brief one or a very lonhg one. Valid examples would include:
-
You must learn what to do after firing a gun. (very brief action)
-
I don't know what you will do after serving a ten-year sentence. (long process)
-
Rome was stable for am long while after building its empire. (hundreds of years)
The same is true for sentences using "when" instead of "after". "When Xing" means "at the time of doing X" but that time could be an instant or a mater of hundreds of years.
-
You must learn what to do when firing a gun. (very brief action)
-
I don't know how you will manage when serving a ten-year sentence. (long process)
-
Rome used several different methods while it was building its empire. (hundreds of years)
The forms "... after reading it" and "... after you read it." suggested in the question are also valid, and in this case carry much the same meaning.