Subscribe to Newsletter Implementation

Hello everyone,

I’m creating a theme for ghost for the first time, and I wanted to get detailed instructions in how to implement a subscription input to my theme. I realize there is a paid members version of this as well, but for now I just wanted to know how someone can freely signup to receive weekly emails.

Thank you!

You can read about the basic coding necessary for a subscription form here:

https://ghost.org/docs/members/signup-signin-forms/#subscription-forms

A live example can be found here:

And the coding for the latter can be found here:

https://github.com/TryGhost/Casper/blob/master/partials/subscribe-form.hbs

2 Likes

Thank you for the reply,

I tried to implement both ways and when I test it by, entering my email and subscribing, the form does nothing. Is there a script I’m missing that I should be also implementing in the theme?

What do you mean by “the form does nothing”? Do you have the “Enable Members” toggle in the “Labs” tab turned on (which will allow you to see subscribers that you’ve collected)?

1 Like

By nothing I mean when I click submit or subscribe the form doesn’t take in my input (the input doesn’t clear the email) and the page stays as is. Yes the enable members is toggled on, I guess a better question would be what is the proper way to make sure the form is working on my local dev environment?

Yes, there is some JS needed (and CSS, if you didn’t grab that already).

Section 7.2 has the CSS, while section 10 has the overlay styling (if you’re after that):

And then there’s the requisite JS, starting at line 89:

Thank you!

1 Like

:tada:

p.s. Don’t forget to upload the loader.hbs file into your /partials/icons/ folder if you’d like the spinning icon effect :wink:

1 Like