Skip to content

High performance, self-hosted, newsletter and mailing list manager with a modern dashboard. Single binary app.

Add `attribs` to campaign docs.

Kailash Nadh5673e61e0ebc
diff --git a/docs/docs/content/apis/campaigns.md b/docs/docs/content/apis/campaigns.md
index 1dd2a4b5..e1034971 100644
--- a/docs/docs/content/apis/campaigns.md
+++ b/docs/docs/content/apis/campaigns.md
@@ -289,22 +289,23 @@ Create a new campaign.
##### Parameters
-| Name | Type | Required | Description |
-| :----------- | :--------- | :------- | :-------------------------------------------------------------------------------------- |
-| name | string | Yes | Campaign name. |
-| subject | string | Yes | Campaign email subject. |
-| lists | number\[\] | Yes | List IDs to send campaign to. |
-| from_email | string | | 'From' email in campaign emails. Defaults to value from settings if not provided. |
-| type | string | Yes | Campaign type: 'regular' or 'optin'. |
-| content_type | string | Yes | Content type: 'richtext', 'html', 'markdown', 'plain', 'visual'. |
-| body | string | Yes | Content body of campaign. |
-| body_source | string | | If content_type is `visual`, the JSON block source of the body. |
-| altbody | string | | Alternate plain text body for HTML (and richtext) emails. |
-| send_at | string | | Timestamp to schedule campaign. Format: 'YYYY-MM-DDTHH:MM:SSZ'. |
-| messenger | string | | 'email' or a custom messenger defined in settings. Defaults to 'email' if not provided. |
-| template_id | number | | Template ID to use. Defaults to default template if not provided. |
-| tags | string\[\] | | Tags to mark campaign. |
-| headers | JSON | | Key-value pairs to send as SMTP headers. Example: \[{"x-custom-header": "value"}\]. |
+| Name | Type | Required | Description |
+| :----------- | :--------- | :------- | :--------------------------------------------------------------------------------------------------------------------- |
+| name | string | Yes | Campaign name. |
+| subject | string | Yes | Campaign email subject. |
+| lists | number\[\] | Yes | List IDs to send campaign to. |
+| from_email | string | | 'From' email in campaign emails. Defaults to value from settings if not provided. |
+| type | string | Yes | Campaign type: 'regular' or 'optin'. |
+| content_type | string | Yes | Content type: 'richtext', 'html', 'markdown', 'plain', 'visual'. |
+| body | string | Yes | Content body of campaign. |
+| body_source | string | | If content_type is `visual`, the JSON block source of the body. |
+| altbody | string | | Alternate plain text body for HTML (and richtext) emails. |
+| send_at | string | | Timestamp to schedule campaign. Format: 'YYYY-MM-DDTHH:MM:SSZ'. |
+| messenger | string | | 'email' or a custom messenger defined in settings. Defaults to 'email' if not provided. |
+| template_id | number | | Template ID to use. Defaults to default template if not provided. |
+| tags | string\[\] | | Tags to mark campaign. |
+| headers | JSON | | Key-value pairs to send as SMTP headers. Example: \[{"x-custom-header": "value"}\]. |
+| attribs | JSON | | Optional JSON object attributes that can be used in the campaign message template. Example `{"location": "Somewhere"}` |
##### Example request
@@ -343,7 +344,9 @@ curl -u "api_user:token" 'http://localhost:9000/api/campaigns' -X POST -H 'Conte
"content_type": "richtext",
"tags": ["test"],
"template_id": 1,
- "messenger": "email"
+ "messenger": "email",
+ "headers": {},
+ "attribs": {}
}
}
```
@@ -516,9 +519,9 @@ Delete multiple campaigns by IDs or by a search query.
##### Parameters
-| Name | Type | Required | Description |
-| :---- | :--------- | :---------------------------- | :--------------------------------------------------------------------------- |
-| id | number\[\] | Yes (if `query` not provided) | Onr or more campaign IDs to delete. |
+| Name | Type | Required | Description |
+| :---- | :--------- | :---------------------------- | :-------------------------------------------------------------------------- |
+| id | number\[\] | Yes (if `query` not provided) | Onr or more campaign IDs to delete. |
| query | string | Yes (if `id` not provided) | Fulltext search query to filter campaigns for deletion (same as GET query). |
##### Example Request (by IDs)
diff --git a/docs/docs/content/apis/subscribers.md b/docs/docs/content/apis/subscribers.md
index 492b3a6c..02be4b7a 100644
--- a/docs/docs/content/apis/subscribers.md
+++ b/docs/docs/content/apis/subscribers.md
@@ -28,7 +28,7 @@ Retrieve all subscribers.
##### Query parameters
| Name | Type | Required | Description |
-|:--------------------|:-------|:---------|:----------------------------------------------------------------------|
+| :------------------ | :----- | :------- | :-------------------------------------------------------------------- |
| query | string | | Subscriber search by SQL expression. |
| list_id | int[] | | ID of lists to filter by. Repeat in the query for multiple values. |
| subscription_status | string | | Subscription status to filter by if there are one or more `list_id`s. |
@@ -140,9 +140,9 @@ Retrieve a specific subscriber.
##### Parameters
-| Name | Type | Required | Description |
-|:--------------|:----------|:---------|:-----------------|
-| subscriber_id | Number | Yes | Subscriber's ID. |
+| Name | Type | Required | Description |
+| :------------ | :----- | :------- | :--------------- |
+| subscriber_id | Number | Yes | Subscriber's ID. |
##### Example Request
@@ -192,9 +192,9 @@ Export a specific subscriber data that gives profile, list subscriptions, campai
##### Parameters
-| Name | Type | Required | Description |
-|:--------------|:----------|:---------|:-----------------|
-| subscriber_id | Number | Yes | Subscriber's ID. |
+| Name | Type | Required | Description |
+| :------------ | :----- | :------- | :--------------- |
+| subscriber_id | Number | Yes | Subscriber's ID. |
##### Example Request
@@ -241,9 +241,9 @@ ______________________________________________________________________
Get a specific subscriber bounce records.
##### Parameters
-| Name | Type | Required | Description |
-|:--------------|:----------|:---------|:-----------------|
-| subscriber_id | Number | Yes | Subscriber's ID. |
+| Name | Type | Required | Description |
+| :------------ | :----- | :------- | :--------------- |
+| subscriber_id | Number | Yes | Subscriber's ID. |
##### Example Request
@@ -300,14 +300,14 @@ Create a new subscriber.
##### Parameters
-| Name | Type | Required | Description |
-|:-------------------------|:----------|:---------|:-----------------------------------------------------------------------------------------------------|
-| email | string | Yes | Subscriber's email address. |
-| name | string | Yes | Subscriber's name. |
-| status | string | Yes | Subscriber's status: `enabled`, `blocklisted`. |
-| lists | number\[\] | | List of list IDs to subscribe to. |
-| attribs | JSON | | Attributes of the new subscriber. |
-| preconfirm_subscriptions | bool | | If true, subscriptions are marked as confirmed and no-optin emails are sent for double opt-in lists. |
+| Name | Type | Required | Description |
+| :----------------------- | :--------- | :------- | :---------------------------------------------------------------------------------------------------------------------------- |
+| email | string | Yes | Subscriber's email address. |
+| name | string | Yes | Subscriber's name. |
+| status | string | Yes | Subscriber's status: `enabled`, `blocklisted`. |
+| lists | number\[\] | | List of list IDs to subscribe to. |
+| attribs | JSON | | Optional JSON object attributes for the subscriber that can be used in message templates. Example `{"location": "Somewhere"}` |
+| preconfirm_subscriptions | bool | | If true, subscriptions are marked as confirmed and no-optin emails are sent for double opt-in lists. |
##### Example Request
@@ -366,11 +366,11 @@ Create a public subscription, accepts both form encoded or JSON encoded body.
##### Parameters
-| Name | Type | Required | Description |
-|:-----------|:----------|:---------|:----------------------------|
-| email | string | Yes | Subscriber's email address. |
-| name | string | | Subscriber's name. |
-| list_uuids | string\[\] | Yes | List of list UUIDs. |
+| Name | Type | Required | Description |
+| :--------- | :--------- | :------- | :-------------------------- |
+| email | string | Yes | Subscriber's email address. |
+| name | string | | Subscriber's name. |
+| list_uuids | string\[\] | Yes | List of list UUIDs. |
##### Example JSON Request
@@ -404,12 +404,12 @@ Modify subscriber list memberships.
##### Parameters
-| Name | Type | Required | Description |
-|:----------------|:----------|:-------------------|:------------------------------------------------------------------|
-| ids | number\[\] | Yes | Array of user IDs to be modified. |
-| action | string | Yes | Action to be applied: `add`, `remove`, or `unsubscribe`. |
-| target_list_ids | number\[\] | Yes | Array of list IDs to be modified. |
-| status | string | Required for `add` | Subscriber status: `confirmed`, `unconfirmed`, or `unsubscribed`. |
+| Name | Type | Required | Description |
+| :-------------- | :--------- | :----------------- | :---------------------------------------------------------------- |
+| ids | number\[\] | Yes | Array of user IDs to be modified. |
+| action | string | Yes | Action to be applied: `add`, `remove`, or `unsubscribe`. |
+| target_list_ids | number\[\] | Yes | Array of list IDs to be modified. |
+| status | string | Required for `add` | Subscriber status: `confirmed`, `unconfirmed`, or `unsubscribed`. |
##### Example Request
@@ -443,9 +443,9 @@ Blocklist a specific subscriber.
##### Parameters
-| Name | Type | Required | Description |
-|:--------------|:----------|:---------|:-----------------|
-| subscriber_id | Number | Yes | Subscriber's ID. |
+| Name | Type | Required | Description |
+| :------------ | :----- | :------- | :--------------- |
+| subscriber_id | Number | Yes | Subscriber's ID. |
##### Example Request
@@ -469,9 +469,9 @@ Blocklist multiple subscriber.
##### Parameters
-| Name | Type | Required | Description |
-|:--------------|:----------|:---------|:-----------------|
-| ids | Number | Yes | Subscriber's ID. |
+| Name | Type | Required | Description |
+| :--- | :----- | :------- | :--------------- |
+| ids | Number | Yes | Subscriber's ID. |
##### Example Request
@@ -497,10 +497,10 @@ Blocklist subscribers based on SQL expression.
##### Parameters
-| Name | Type | Required | Description |
-|:---------|:---------|:---------|:--------------------------------------------|
-| query | string | Yes | SQL expression to filter subscribers with. |
-| list_ids | []number | No | Optional list IDs to limit the filtering to.|
+| Name | Type | Required | Description |
+| :------- | :------- | :------- | :------------------------------------------- |
+| query | string | Yes | SQL expression to filter subscribers with. |
+| list_ids | []number | No | Optional list IDs to limit the filtering to. |
##### Example Request
@@ -526,9 +526,9 @@ Delete a specific subscriber.
##### Parameters
-| Name | Type | Required | Description |
-|:--------------|:----------|:---------|:-----------------|
-| subscriber_id | Number | Yes | Subscriber's ID. |
+| Name | Type | Required | Description |
+| :------------ | :----- | :------- | :--------------- |
+| subscriber_id | Number | Yes | Subscriber's ID. |
##### Example Request
@@ -552,9 +552,9 @@ Delete a subscriber's bounce records
##### Parameters
-| Name | Type | Required | Description |
-|:-----|:--------------|:---------|:---------------------------|
-| id | subscriber_id | Yes | Subscriber's ID. |
+| Name | Type | Required | Description |
+| :--- | :------------ | :------- | :--------------- |
+| id | subscriber_id | Yes | Subscriber's ID. |
##### Example Request
@@ -578,9 +578,9 @@ Delete one or more subscribers.
##### Parameters
-| Name | Type | Required | Description |
-|:-----|:----------|:---------|:---------------------------|
-| id | number\[\] | Yes | Array of subscriber's IDs. |
+| Name | Type | Required | Description |
+| :--- | :--------- | :------- | :------------------------- |
+| id | number\[\] | Yes | Array of subscriber's IDs. |
##### Example Request
@@ -605,7 +605,7 @@ Delete subscribers based on SQL expression.
##### Parameters
| Name | Type | Required | Description |
-|:---------|:---------|:---------|:-------------------------------------------------------------------|
+| :------- | :------- | :------- | :----------------------------------------------------------------- |
| query | string | No | SQL expression to filter subscribers with. |
| list_ids | []number | No | Optional list IDs to limit the filtering to. |
| all | bool | No | When set to `true`, ignores any query and deletes all subscribers. |