To send a post by email, the newsletter query parameter must be passed when publishing or scheduling the post, containing the newsletter’s slug.
Does this mean that I cannot do this from within the client and must use the endpoint? It’s not clear.
In cases like this, it’s time “use the source, Luke!”.
The source for the Admin API shows that the edit() method has an undocumented second parameter that accepts query parameters:
So that’s where you can adding the query params for newsletter mailings described here:
@markstos Thanks for doing the research The docs themselves are in a private repo, but I think you could add this as an issue in the SDK. It’s also on my radar now, so I’ll work on updating the docs to reflect this option!
If something’s missing from the docs in the future, you can message me on the Forum, too!
Thanks. I have some JS code that successfully posts via the API , makes status published, and includes the query string params. But it won’t send out via email on the Admin API, despite the query string being included (I think).
Does this make sense to you? And thanks again.
var html = '<p>Testing email sending through API</p>'
title: 'Testing Email Sending Through API',
I have tried to modify and email existing posts, as well as send new posts via email, and neither version of the code sends the email. I can modify properties, but not send anything via email. I can obviously send via email manually.
Okay, I got it to work. I had to post the entry first, and then modify its status to published with the edit function, and then add the query string params. Thanks for your help.