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:
Jeff Emmett 2026-03-22 16:51:39 -07:00
parent 5e09407d38
commit f32dcb7316
1 changed files with 3 additions and 3 deletions

View File

@ -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) {