How to create a custom action within context of the current record
civix is a cli tool that will help you a lot to write that extension. you will have to:


write a hook to get that extra token
add a page to let the user add the custom message (civix generate:page once you have generated the extension)


Instead of a token, it might be easier to generate the html and merge your html table, the custom message and a template and send it as a mail (or generate the pdf)

As for the custom link, it depends on which screen and how you want to add it, we might have already a hook to add an extra action, or you can use a hook when the form/page is generated to add the needed buttons/links.