Managing Ghost's subscriber list

Create webhooks to store, access & update Ghost's subscriber list using Google Apps Script.

Managing Ghost's subscriber list
Managing Ghost's subscriber list

if i didn't know any better, i'd have been very upset but thanks to the well understood and documented constructs from the ghost(.org) team, turns out that their subscribers feature only...

...allows you to capture email addresses of people who would like to subscribe to your publication's content. Email addresses can be viewed and edited from Ghost admin, but no emails will be sent without further integrations with an email tool.

this gave me an idea for yet another use of apps script!

via GIPHY
via GIPHY

prior reading

context

ghost already does have an amazing list of email integrations with some of the industry-leading tools that virtually offer services at 0 cost (to begin with); however, there are these tiny bits of restriction with every free service. either they control the number of contacts you can send emails to or restrict the number of emails you're allowed to trigger at a stipulated duration etc.; this is in no way to say that building a custom integration (using apps script) would take any of these challenges away but you could at least control the flow of what ought to be done to its most intrinsic, granular detail.

i suppose the aforementioned quote summarises the problem statement as well.

architecture

imo, once you get used to building simple doget() or dopost() web apps, it becomes super simple to handle if-else cases, along with appending data to spreadsheet. this solution follows a fairly similar model with which a custom integration is created and the same (single) webhook is added as url to both - subscribers added & subscribers deleted - events.

these are currently the other available events -

events - Ghost's custom integration
events - Ghost's custom integration

codebase

you can access the entire script on my github repository here. once deployed, you may add that url by choosing to create a new custom integration from the ghost panel as below -

Custom integration - Ghost
Custom integration - Ghost

ps. this also opens up the opportunity to send emails using apps script, as and when a new post is published but that's a blog for another time (feeling pretty lazy right now to code an entire module for sending emails altogether 😛).