Is there a proper way to override core ghost files?

I’m experimenting with self-hosting Ghost and interested in setting up the memberships / subscriptions module. I run my own bulk email sending service (not an SMTP server - a real bulk sending service functionally similar to mailgun) and I don’t want to pay mailgun for services I run myself. I understand there are no plans within Ghost to support other bulk email services besides mailgun.

Looking at the Ghost repo, it seems like I should hack on /core/server/services/bulk-email/index.js in order to redirect bulk email to my own service, but obviously the next Ghost update will wreck my hacking.

Is there a proper way to override core files or core file functionality like this that won’t get clobbered on updates?

We will support other bulk mail services in future - it’s not possible at present. (Same as payment providers and stripe)

It’s not possible to override core files, but you can use Ghost’s APIs to accomplish the same thing (which is also how you can use payment providers other than Stripe, atm)

Hey, thanks. So I’m looking at the API and at a glance I don’t see any endpoints that are specifically related to memberships / subscriptions. I’m comfortable writing code against an API. If you were going to use the API to replace the dependence on mailgun, where would you start?

Members API is actively changing and unstable, because beta, but the approach I would use is to sync the members database externally using webhooks (optionally, via Zapier) - and make it work however you like.

There are lots of options, you could listen for a post_published webhook and then query the content API to get the content and deliver it to subscribers, or you could just set up something that tracks your RSS feed and use that.

You can get both the members and the content out of Ghost, so what you do after that is pretty limitless

Thanks again. I see that there are webhook events for members added, edited, and deleted, so that makes sense. Also the post_published webhook :white_check_mark: . Do you have any idea when you guys might be publishing a “browse members” endpoint? Would be nicest not to have to maintain a separate db / table for data that already exists in the ghost db.

I mean there are some API endpoints which are relatively easy to find, but they’re not documented/stable yet. They will be as soon as we’re out of beta, which will be later this year :slight_smile:

Gotcha - thanks.