Running Ghost 5.2.2 and using the Admin API to publish posts.
Alongside publishing the post via the API, I want it to send it out to a specified newsletter.
As far as I can tell from the Ghost documentation (Ghost Admin API Documentation) all I need to do is add ?newsletter={{newsletter-slug}} to the query string when I create the post. However it schedules the post, but doesn’t schedule/send the email.
Everything appears to be working well (in terms of scheduling and publishing posts), just not sending out the emails.
Hi!
I think I have the same problem but am confused by where exactly you are inserting the PUT call to /posts/{postId}/?newsletter={newsletter} ?
My problem:
• I sent (only) a newsletter to members, but ‘View in Browser’ turns up 404 error.
• In the console, the post shows as a draft meaning no analytics are available.
• I don’t want the post published on site but do need it viewable in browsers. And that is the only available option in the console — which has never happened before today.
No idea why this occurred, does this seem like the issue you experienced?
Thanks in advance, this is embarrassing!
PS: Here are console views if it helps.
1 — Publish pane, showing it has been sent
2 — Editor view, showing 'draft saved and Publish option
3 — Admin console Draft status
Hi, @EOBSL . Not embarrassing at all! But I don’t think we are dealing with the same issue. If I understand correctly, you are working from the console only; I am creating the text outside Ghost, and using the API with a Python script to send the post to Ghost and to the newsletter; the PUT request is made by the script.
Anyway, in my case, my script works as follows:
send the post as a draft first (POST request to /posts/);
update the post to published and send the newsletter (PUT request to /posts/{postId}/?newsletter={newsletter})
In your case, while the post is a draft, it will indeed show a 404 error to the users. If you are using API calls, perhaps this above may help. Cheers!