Fix newsletter subscription endpoint to use Listmonk public API
The form was POSTing to /subscription/form (404) instead of /api/public/subscription with JSON payload. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
5e09407d38
commit
f32dcb7316
|
|
@ -868,10 +868,10 @@ document.getElementById('newsletter-form').addEventListener('submit', async func
|
||||||
submitBtn.disabled = true;
|
submitBtn.disabled = true;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const response = await fetch(LISTMONK_URL + '/subscription/form', {
|
const response = await fetch(LISTMONK_URL + '/api/public/subscription', {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
|
headers: { 'Content-Type': 'application/json' },
|
||||||
body: new URLSearchParams({ email: email, list: LIST_UUID, name: '' }),
|
body: JSON.stringify({ email: email, list_uuids: [LIST_UUID] }),
|
||||||
});
|
});
|
||||||
|
|
||||||
if (response.ok) {
|
if (response.ok) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue