Hi Jonathan,
Depending on your requirements, you may be able to leverage the standard components for your purposes. The components just display as links, but if you wanted to you could create a custom component, insert the component(s) using the <@component> FreeMarker macro, wrap the component with your own HTML and style as needed.
Here are the subscription-related components for a thread:
<component id="subscriptions.action.remove-thread-user-float" />
<component id="subscriptions.action.add-thread-user-float" />
<component id="subscriptions.action.remove-thread-user-bookmark" />
<component id="subscriptions.action.add-thread-user-bookmark" />
<component id="subscriptions.action.remove-thread-user-email" />
<component id="subscriptions.action.add-thread-user-email" />
and for a message:
<component id="subscriptions.action.remove-message-user-float" />
<component id="subscriptions.action.add-message-user-float" />
<component id="subscriptions.action.remove-message-user-bookmark" />
<component id="subscriptions.action.add-message-user-bookmark" />
<component id="subscriptions.action.remove-message-user-email" />
<component id="subscriptions.action.add-message-user-email" />
You'll likely be interested in the "email" ones, but I provided the others just in case. You'll want to make sure you only use these components on pages where they're going to have the appropriate thread/message context (ie. a ForumMessage page)
Alternately, you could use the REST API to add/remove the subscriptions, but that's probably going to be quite a bit more complex. Let me know if you'd prefer to go down that route, and I can provide some additional details to get you started.
I hope this helps!