# Code for my newsletter sign up

**URL:** <https://forum.ghost.org/t/code-for-my-newsletter-sign-up/43975>\
**Category:** Developer help\
**Created:** [January 9, 2024, 3:20am UTC](https://forum.ghost.org/t/code-for-my-newsletter-sign-up/43975 "2024-01-09T03:20:22Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kate\_Pascoe](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/kate_pascoe/32/26705_2.png) [@Kate\_Pascoe](https://forum.ghost.org/u/Kate_Pascoe)\
**Post date:** [January 9, 2024, 3:20am UTC](https://forum.ghost.org/t/code-for-my-newsletter-sign-up/43975/1 "2024-01-09T03:20:23Z")

</div>

I just need the code for newsletter sign up from my ghost blog for my website. The embed code doesn’t work,

My developer has built my website in react/ next.js. We want to put a newsletter signup on the footer of my home page.

Thanks

My new website api is temporarily hosted on brisbaneosteopaths.com.au

My ghost blog url is [health-hacks.ghost.io](http://health-hacks.ghost.io)

Kate

If you’re looking for help, please provide information about your environment. If you delete this template and don’t provide any information, your topic will be automatically closed.

If you aren’t running the latest version of Ghost, the first thing we’ll ask you to do is update to the latest version of Ghost.

- **What’s your URL**? This is the easiest way for others to help you
- **What version of Ghost are you using?** If it’s not the latest, please update Ghost first before opening your topic

And

- How was Ghost installed and configured?
- What Node version, database, OS & browser are you using?
- What errors or information do you see in the console?
- What steps could someone else take to reproduce the issue you’re having? _emphasized text_

---

<div class="post-metadata">

**Author:** ![jannis](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/jannis/32/39718_2.png) [@jannis](https://forum.ghost.org/u/jannis)\
**Post date:** [January 9, 2024, 5:47am UTC](https://forum.ghost.org/t/code-for-my-newsletter-sign-up/43975/2 "2024-01-09T05:47:43Z")

</div>

Hey Kate!

Have you tried the embeddable signup form? The goal of that is to provide a snippet that can be used anywhere on the web:

> **[Embeddable signup forms](https://ghost.org/help/embeddable-signup-forms/)**
>
> Yes! You can create custom embeddable signup forms, that can be used anywhere on the web.

If, for whatever reason, that doesn’t work, your developer can also create a simple form in your NextJS site and call the Ghost Members API:

> **[Subscribing Ghost Members From Your JAMStack Site](https://www.jakewiesler.com/blog/ghost-jamstack-memberships)**
>
> This post will explain how JAMStack sites using Ghost as a headless CMS can subscribe readers to an email list using Ghost Memberships.

Keep in mind though that your Ghost Admin API key should not be used in the frontend. In the context of NextJS I would rather create an API route that executes the call to Ghost.

If you’re using Ghost as a headless CMS behind a NextJS frontend, there will be some thing that won’t work:

> **[Can I run a headless site with Ghost(Pro)?](https://ghost.org/help/can-i-run-a-headless-site-with-ghost-pro/)**
>
> Ghost(Pro) can be used as a Headless CMS with other third-party front-end frameworks, such as NextJS, Gatsby and more.

---

<div class="post-metadata">

**Author:** ![Kate\_Pascoe](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/kate_pascoe/32/26705_2.png) [@Kate\_Pascoe](https://forum.ghost.org/u/Kate_Pascoe)\
**Post date:** [January 11, 2024, 2:19am UTC](https://forum.ghost.org/t/code-for-my-newsletter-sign-up/43975/3 "2024-01-11T02:19:29Z")

</div>

Thankyou, I have passed that info on to my developer, seeing as the embeddable form does not work. I have another question: I can’t get my purchased domain for my newsletter blog to work with my ghost (hosted) site [health-hacks.ghost.io](http://health-hacks.ghost.io)

Pretty sure the domain DNS is good for the domain healthhacks.au; the problem is something on the Ghost end, although everything looks fine with what I have done…

---

<div class="post-metadata">

**Author:** ![Cathy\_Sarisky](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/cathy_sarisky/32/25750_2.png) [@Cathy\_Sarisky](https://forum.ghost.org/u/Cathy_Sarisky)\
**Post date:** [January 11, 2024, 1:21pm UTC](https://forum.ghost.org/t/code-for-my-newsletter-sign-up/43975/4 "2024-01-11T13:21:53Z")

</div>

Since you’re a Ghost Pro customer, you can email them if you need help with your DNS config.

Having said that, maybe I can save you some time: Often it takes a couple tries (and sometimes a couple hours) before a newly transferred domain will validate with Ghost. DNS caching is ‘fun’. So before you email them, I’d try to validate the domain again. Your settings look fine to me, so it’ll probably validate – this time.

---

<div class="post-metadata">

**Author:** ![ronanpdh](https://avatars.discourse-cdn.com/v4/letter/r/9fc29f/32.png) [@ronanpdh](https://forum.ghost.org/u/ronanpdh)\
**Post date:** [January 26, 2025, 3:39am UTC](https://forum.ghost.org/t/code-for-my-newsletter-sign-up/43975/5 "2025-01-26T03:39:11Z")

</div>

I know this is from a while ago, but thought I would drop this fix in just incase others run into it. I was running into this issue with embedding my signup to my NextJS site. The issue I had was using the regular tags. For Next it works better to use the Component, as soon as I switched this out it loaded just fine. [https://nextjs.org/docs/pages/api-reference/components/script](https://nextjs.org/docs/pages/api-reference/components/script)
