Where does the unsubscribe link come from in email newsletter?

Hi,

I’m trying to set up an email newsletter with a custom template that I created. And I want to send this newsletter periodically with dynamic content. I’ve thought a solution to do this:

I would create a script that pulls content and author information from my Ghost blog (using the Content API), generates the email template with the custom template I have, and sends an email (through Mailgun API) to each user (whose email information is received through the Admin API).

FIRST QUESTION:
However, I need to have the unsubscribe link that Ghost inserts into newsletters automatically (when you send a newsletter through a post). How do you get the unsubscribe link for a user (whose ID and email I know (through the Admin API))?

The idea is that, if I can generate the unsubscribe link for each user in my script, I can include that in my custom template that I would generate.

SECOND QUESTION:
How can I add functionality to the Ghost Admin page? I would like to give authors this functionality:

Author lists post IDs, my script generates the email template filling in the dynamic content based on the listed post IDs, author views email preview (similar to how you can view an email preview of a post when you create a post).

I know how to create the script that would use the Ghost Admin and Content API and generate the email template. But I don’t know how to add a new custom section on the Ghost admin page.