# \[SOLVED\] Newsletter missing from POST request of data-members-form

**URL:** <https://forum.ghost.org/t/solved-newsletter-missing-from-post-request-of-data-members-form/41880>\
**Category:** Themes\
**Created:** [October 14, 2023, 12:58am UTC](https://forum.ghost.org/t/solved-newsletter-missing-from-post-request-of-data-members-form/41880 "2023-10-14T00:58:13Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![jordankittle](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/jordankittle/32/24868_2.png) [@jordankittle](https://forum.ghost.org/u/jordankittle)\
**Post date:** [October 14, 2023, 12:58am UTC](https://forum.ghost.org/t/solved-newsletter-missing-from-post-request-of-data-members-form/41880/1 "2023-10-14T00:58:13Z")

</div>

[SOLVED] by upgrading to latest version of Ghost

Hello everyone,

I am trying to implement two different newsletter signup forms on different pages in my theme.I am following the instructions at [Ghost Theme Development: Building custom membership flows](https://ghost.org/docs/themes/members/)

However, when I specify which newsletter the data-members-form should be signing up for, with the hidden input element, it does not work. The only way to get a member to sign up for a newsletter is to have that newsletter automatically subscribe new members to it, and for the member to not exist before signup.

If the member already exists, the form just acts as a login form, with no signup e-mail ever sent, even though I am specifying data-members-form=“subscribe”

Here is the html from my theme

```auto
<form data-members-form="subscribe">
    <input type="email" name="email" data-members-email required="true" autocomplete="off">
    <input data-members-newsletter type="hidden" value="Test Newsletter" />
    <button type="submit">SUBSCRIBE</button>
</form>

```

This form will never cause a member to be signed up to receive the “Test Newsletter”, but according to the instructions in the Ghost docs it should. Any help would be very much appreciated.

---

<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:** [October 14, 2023, 1:06am UTC](https://forum.ghost.org/t/solved-newsletter-missing-from-post-request-of-data-members-form/41880/2 "2023-10-14T01:06:36Z")

</div>

I think you need the slug of the newsletter, not it’s name…

---

<div class="post-metadata">

**Author:** ![jordankittle](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/jordankittle/32/24868_2.png) [@jordankittle](https://forum.ghost.org/u/jordankittle)\
**Post date:** [October 14, 2023, 1:08am UTC](https://forum.ghost.org/t/solved-newsletter-missing-from-post-request-of-data-members-form/41880/3 "2023-10-14T01:08:25Z")

</div>

Hi Cathy\_Sarisky thank you very much for replying! In the ghost docs they don’t appear to be using slugs, but rather the title of the Newsletter:

```auto
<form data-members-form>
  ...
  <input data-members-newsletter type="hidden" value="Weekly Threads" />
  <input data-members-newsletter type="hidden" value="Shocking Revelations" />

  
  <button type="submit">Subscribe</button>
</form>

```

Where do I find or set the Newsletter slug?

---

<div class="post-metadata">

**Author:** ![jordankittle](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/jordankittle/32/24868_2.png) [@jordankittle](https://forum.ghost.org/u/jordankittle)\
**Post date:** [October 14, 2023, 1:12am UTC](https://forum.ghost.org/t/solved-newsletter-missing-from-post-request-of-data-members-form/41880/4 "2023-10-14T01:12:21Z")

</div>

When I edit my newsletter, there is a slug of random numbers and letters in the URL, I tried that and it still does not work.

---

<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:** [October 14, 2023, 1:27am UTC](https://forum.ghost.org/t/solved-newsletter-missing-from-post-request-of-data-members-form/41880/5 "2023-10-14T01:27:44Z")

</div>

let me give it a try on my test setup.

---

<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:** [October 14, 2023, 1:39am UTC](https://forum.ghost.org/t/solved-newsletter-missing-from-post-request-of-data-members-form/41880/6 "2023-10-14T01:39:47Z")

</div>

Hey @jordankittle

I just tried it out and it worked OK for me, using the newsletter name. Are you sure it isn’t working for you? Where does it go wrong? Do you not get a magic link, or do you not see the subscriptions appear in your account _after you click the magic link_ ? (Until the subscriber clicks the link, they aren’t going to show up as subscribed.)

I tried it with two newsletters, exactly like you have it, too. Worked fine!

---

<div class="post-metadata">

**Author:** ![jordankittle](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/jordankittle/32/24868_2.png) [@jordankittle](https://forum.ghost.org/u/jordankittle)\
**Post date:** [October 14, 2023, 1:42am UTC](https://forum.ghost.org/t/solved-newsletter-missing-from-post-request-of-data-members-form/41880/7 "2023-10-14T01:42:33Z")

</div>

Hey Cathy,

My situation is that after the user submits the form they are not subscribed to the newsletter.

I am getting the magic link and clicking it. Sorry forgot to add that.

---

<div class="post-metadata">

**Author:** ![jordankittle](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/jordankittle/32/24868_2.png) [@jordankittle](https://forum.ghost.org/u/jordankittle)\
**Post date:** [October 14, 2023, 1:48am UTC](https://forum.ghost.org/t/solved-newsletter-missing-from-post-request-of-data-members-form/41880/8 "2023-10-14T01:48:52Z")

</div>

I have tried deleting my member and using the form as a new member, and when the member already exists. In the case that the member already exists I get a sign-in e-mail only, as expected per Ghost docs. When the member doesn’t exist I get a subscribe e-mail as expected, but in both cases the user is not added to my 2nd Newsletter, even though I have copied the Newsletter name and then Ctrl+F to verify it in my code editor where I specify the value of the newsletter in the hidden input element. And even though the magic link is being received and clicked.

---

<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:** [October 14, 2023, 1:55am UTC](https://forum.ghost.org/t/solved-newsletter-missing-from-post-request-of-data-members-form/41880/9 "2023-10-14T01:55:55Z")

</div>

Super weird! Which version of Ghost? Is the site online so I can try it? :)

---

<div class="post-metadata">

**Author:** ![jordankittle](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/jordankittle/32/24868_2.png) [@jordankittle](https://forum.ghost.org/u/jordankittle)\
**Post date:** [October 14, 2023, 2:03am UTC](https://forum.ghost.org/t/solved-newsletter-missing-from-post-request-of-data-members-form/41880/10 "2023-10-14T02:03:09Z")

</div>

It is very weird! Yes the site is online but the page with the second signup form hasn’t been released yet. Maybe I can make a test route for you. Edit: DM’ed you the link!

---

<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:** [October 14, 2023, 2:31am UTC](https://forum.ghost.org/t/solved-newsletter-missing-from-post-request-of-data-members-form/41880/11 "2023-10-14T02:31:05Z")

</div>

So that’s interesting. I can see where you have `<input data-members-newsletter="" type="hidden" value="JAN3 Financial">`

But when I submit, the ‘newsletters’ part of the POST is missing. So it seems like the Portal code that should process that submission is not quite working right - it’s definitely a problem on the POST side, not the API side.

---

<div class="post-metadata">

**Author:** ![jordankittle](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/jordankittle/32/24868_2.png) [@jordankittle](https://forum.ghost.org/u/jordankittle)\
**Post date:** [October 14, 2023, 2:40am UTC](https://forum.ghost.org/t/solved-newsletter-missing-from-post-request-of-data-members-form/41880/12 "2023-10-14T02:40:29Z")

</div>

Thank you for checking on that for me! Is this something I should open a support ticket with Ghost for?

Edit: You’re right! I just inspected the network request for the magic link and there is nothing about which newsletters. The only thing that comes to mind is that there are two forms on this page, one is for mobile. Maybe something is having trouble with two data-members-newsletter elements on the same page.

---

<div class="post-metadata">

**Author:** ![jordankittle](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/jordankittle/32/24868_2.png) [@jordankittle](https://forum.ghost.org/u/jordankittle)\
**Post date:** [October 14, 2023, 2:48am UTC](https://forum.ghost.org/t/solved-newsletter-missing-from-post-request-of-data-members-form/41880/13 "2023-10-14T02:48:42Z")

</div>

I have submitted the form too many times for testing and am getting errors now. When I can I will test the form in mobile view to see if that form also submits without the newsletters in the POST request.

---

<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:** [October 14, 2023, 2:49am UTC](https://forum.ghost.org/t/solved-newsletter-missing-from-post-request-of-data-members-form/41880/14 "2023-10-14T02:49:03Z")

</div>

I don’t think it’s a Ghost support issue. I’m not even sure it’s a generalizable bug (which would merit raising an issue on Github). I suspect it’s something to do with the other javascript on the page --there’s a lot going on!

If you create a very simple page with just that little bit of html, does it work correctly? I see you have some other code also firing on the ‘subscribe’ button click - I wonder if that’s interfering?

For comparison, here’s a correctly formatted POST from the simple example.

Code:

```auto
<form data-members-form="subscribe">
    <input type="email" name="email" data-members-email required="true" autocomplete="off">
    <input data-members-newsletter type="hidden" value="Cathy's second newsletter" />
      <input data-members-newsletter type="hidden" value="CSOFutures" />
    <button type="submit">SUBSCRIBE</button>
</form>

```

POST (as seen in dev tools, goes to /members/api/send-magic-link/:

```auto
{
  "email": "me+teststringsoIcanmakemoreaccounts@gmail.com",
  "emailType": "subscribe",
  "labels": [],
  "autoRedirect": true,
  "urlHistory": [
    --bunch of stuff removed -- 
  ],
  "newsletters": [
      {"name": "Cathy's second newsletter" },{ "name": "CSOFutures" }
  ]
}
```

---

<div class="post-metadata">

**Author:** ![jordankittle](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/jordankittle/32/24868_2.png) [@jordankittle](https://forum.ghost.org/u/jordankittle)\
**Post date:** [October 14, 2023, 2:54am UTC](https://forum.ghost.org/t/solved-newsletter-missing-from-post-request-of-data-members-form/41880/15 "2023-10-14T02:54:35Z")

</div>

I just commented out the entire event listener on the submit button. Still no newsletter data in the POST request. :(

---

<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:** [October 14, 2023, 2:58am UTC](https://forum.ghost.org/t/solved-newsletter-missing-from-post-request-of-data-members-form/41880/16 "2023-10-14T02:58:36Z")

</div>

Boo. :( It might be time to make a new template and strip everything out of it to make sure THAT works, then start adding bits back until you break it?

ALTERNATIVELY, there’s no reason you have to use the Portal form setup at all. You just have to construct the post request, and you can 100% do that manually. So you could remove the data-members-form, data-members-newsletter, etc, and just make your post request to one of your existing event listeners bound on that button…

I’m not sure which is going to be easier at this point.

---

<div class="post-metadata">

**Author:** ![jordankittle](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/jordankittle/32/24868_2.png) [@jordankittle](https://forum.ghost.org/u/jordankittle)\
**Post date:** [October 14, 2023, 3:03am UTC](https://forum.ghost.org/t/solved-newsletter-missing-from-post-request-of-data-members-form/41880/17 "2023-10-14T03:03:43Z")

</div>

Thank you that sounds like a good solution if I can’t find any other way! I am testing right now on a basic page with a single form.

---

<div class="post-metadata">

**Author:** ![jordankittle](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/jordankittle/32/24868_2.png) [@jordankittle](https://forum.ghost.org/u/jordankittle)\
**Post date:** [October 14, 2023, 3:08am UTC](https://forum.ghost.org/t/solved-newsletter-missing-from-post-request-of-data-members-form/41880/18 "2023-10-14T03:08:37Z")

</div>

I removed all event listeners from all buttons and still the same POST request. I think at this point I will have to try it the way you described and build the request myself.

---

<div class="post-metadata">

**Author:** ![jordankittle](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/jordankittle/32/24868_2.png) [@jordankittle](https://forum.ghost.org/u/jordankittle)\
**Post date:** [October 14, 2023, 3:14am UTC](https://forum.ghost.org/t/solved-newsletter-missing-from-post-request-of-data-members-form/41880/19 "2023-10-14T03:14:43Z")

</div>

Thank you very much for all your help. One last question, this Ghost version is [5.60.0], which version did you use on your test site?

---

<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:** [October 14, 2023, 3:33am UTC](https://forum.ghost.org/t/solved-newsletter-missing-from-post-request-of-data-members-form/41880/20 "2023-10-14T03:33:04Z")

</div>

I’ve got 5.68 on my test site.

[Next page](https://forum.ghost.org/t/solved-newsletter-missing-from-post-request-of-data-members-form/41880.md?page=2)
