Edit: I have rephrased and rewritten this to make more sense to you, perhaps...
If you generate the email on your own, you can embed any info you want into the URL of the link. Ever thought of that?
1. There is no need to have code within the email to be able to act on the click event of the link.
2. Code doing such a thing would be much more complex than simply putting the subject text into the URL, URL encoded, of course.
3. Any code, which could theoretically run within HTML in general, would be JS (Javascript), but Outlook - any mail client - won't execute that, Outlook is not a browser.
So:
1. There is a simpler solution
2. Even if there would be a complicated solution within a browser ...
3. ...it would be impossible to execute in a mail client, not only in Outlook.
Furthermore: Even if it would be possible to execute JS within an HTML mail, how would it access mail item fields? It would have access to the HTML the DOM of the email body text, but there would be no natural object name or reference to get at the mail item and its properties.
So there is nothing you can do within the email, everything has to be done when generating/sending the mail already and then can be processed as info coming in with the click of the link at the web server, so any info you want to transport has to be part of the link itself already.
Last, not least:
You might have seen some functionality like this in Outlook within your company, then ask the makers of what you saw. I guess they make use of Outlook Forms, which are based on Office Forms and work with code having access to the current mail item fields, as far as I googled. You need to have admin rights to a company repository of Outlook Forms and then can refer to them and send them to Company Recipients. It's a bit like a simple Intranet working on email basis. I never used them, but that's a whole world on its own besides text or HTML emails and to get to know this I recommend you look for an Outlook forum and ask about the capabilities of Outlook Forms.
Bye, Olaf.