TOC in email notification?

Some email clients support some HTML and CSS, but JS is not really available AFAIK. But maybe a plugin to intercept emails, add a simple TOC at the start and send? Is that even possible though?