Newsletter API¶
Overview¶
The newsletter API allows users to subscribe to the Meister Bill newsletter. It integrates with nl.code-nexus.co to manage subscriber data and tags.
Endpoints¶
POST /newsletter/subscribe¶
Subscribe a user to the newsletter list.
Request¶
{
"email": "user@example.com",
"name": "John Doe",
"tags": ["prelaunch", "early-adopter"]
}
Request Body Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
email |
string | Yes | The subscriber's email address |
name |
string | Yes | The subscriber's full name |
tags |
string[] | No | Tags to apply to the subscriber. Frontend should send "prelaunch" during prelaunch phase |
Response¶
{
"message": "Successfully subscribed to newsletter",
"success": true
}
Response Fields:
| Field | Type | Description |
|---|---|---|
message |
string | Success message |
success |
boolean | Indicates if the subscription was successful |
Error Responses¶
400 Bad Request
{
"error": "Invalid email address",
"message": "Invalid email address"
}
500 Internal Server Error
{
"error": "Failed to subscribe to newsletter",
"message": "Failed to subscribe to newsletter"
}
Tags¶
Tags are used to segment subscribers for targeted campaigns. Common tags include:
prelaunch- Subscribers who signed up during prelaunch phaseearly-adopter- Early adopters of the platformbeta-tester- Users participating in beta testing
Implementation Notes¶
- The API uses nl.code-nexus.co's
/api/lists/{id}/feedendpoint - Tags are passed directly to the newsletter service
- Frontend should send appropriate tags based on the current phase
- The
NEWSLETTER_LIST_IDandNEWSLETTER_API_KEYenvironment variables must be configured
Development¶
For development/testing, you can enable fake subscribe mode by setting:
NEWSLETTER_FAKE_SUBSCRIBE=true
This will return a success response without actually subscribing to the newsletter service.