You can do the same in an AJAX call to take the id , generate the email using the url link method.
The problem i realise with this method is that the email you send (if you are sending html 0 will contain links to stylesheets etc and would need to be parsed to change all local links to links the users email client will see
e.g. you might need to change
This can be done in a script