Skip to content

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

Add visual template and new permissions to docs.

Kailash Nadh925cdf282dc1
diff --git a/docs/docs/content/apis/campaigns.md b/docs/docs/content/apis/campaigns.md
index 1c7d7bbd..9f4d7864 100644
--- a/docs/docs/content/apis/campaigns.md
+++ b/docs/docs/content/apis/campaigns.md
@@ -66,6 +66,7 @@ Retrieve all campaigns.
"subject": "Welcome to listmonk",
"from_email": "No Reply <[email protected]>",
"body": "<h3>Hi {{ .Subscriber.FirstName }}!</h3>\n\t\t\tThis is a test e-mail campaign. Your second name is {{ .Subscriber.LastName }} and you are from {{ .Subscriber.Attribs.city }}.",
+ "body_source": null,
"send_at": "2020-03-15T17:36:41.293233+01:00",
"status": "draft",
"content_type": "richtext",
@@ -128,6 +129,7 @@ curl -u "api_user:token" -X GET 'http://localhost:9000/api/campaigns/1'
"subject": "Welcome to listmonk",
"from_email": "No Reply <[email protected]>",
"body": "<h3>Hi {{ .Subscriber.FirstName }}!</h3>\n\t\t\tThis is a test e-mail campaign. Your second name is {{ .Subscriber.LastName }} and you are from {{ .Subscriber.Attribs.city }}.",
+ "body_source": null,
"send_at": "2020-03-15T17:36:41.293233+01:00",
"status": "draft",
"content_type": "richtext",
@@ -286,21 +288,22 @@ 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'. |
-| body | string | Yes | Content body of campaign. |
-| 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"}\]. |
##### Example request
@@ -332,6 +335,7 @@ curl -u "api_user:token" 'http://localhost:9000/api/campaigns' -X POST -H 'Conte
"subject": "Hello, world",
"from_email": "listmonk \[email protected]\u003e",
"body": "",
+ "body_source": null,
"altbody": null,
"send_at": null,
"status": "draft",
diff --git a/docs/docs/content/apis/templates.md b/docs/docs/content/apis/templates.md
index 0d2a0eb2..caab6ce6 100644
--- a/docs/docs/content/apis/templates.md
+++ b/docs/docs/content/apis/templates.md
@@ -34,6 +34,7 @@ curl -u "api_user:token" -X GET 'http://localhost:9000/api/templates'
"updated_at": "2020-03-14T17:36:41.288578+01:00",
"name": "Default template",
"body": "{{ template \"content\" . }}",
+ "body_source": null,
"type": "campaign",
"is_default": true
}
@@ -69,6 +70,7 @@ curl -u "api_user:token" -X GET 'http://localhost:9000/api/templates/1'
"updated_at": "2020-03-14T17:36:41.288578+01:00",
"name": "Default template",
"body": "{{ template \"content\" . }}",
+ "body_source": null,
"type": "campaign",
"is_default": true
}
@@ -118,12 +120,13 @@ Create a template.
##### Parameters
-| Name | Type | Required | Description |
-|:--------|:----------|:---------|:----------------------------------------------|
-| name | string | Yes | Name of the template |
-| type | string | Yes | Type of the template (`campaign` or `tx`) |
-| subject | string | | Subject line for the template (only for `tx`) |
-| body | string | Yes | HTML body of the template |
+| Name | Type | Required | Description |
+|:------------|:-------|:---------|:------------------------------------------------------------------------------|
+| name | string | Yes | Name of the template |
+| type | string | Yes | Type of the template (`campaign`, `campaign_visual`, or `tx`) |
+| subject | string | | Subject line for the template (only for `tx`) |
+| body_source | string | | If type is `campaign_visual`, the JSON source for the email-builder tempalate |
+| body | string | Yes | HTML body of the template |
##### Example Request
@@ -149,6 +152,7 @@ curl -u "api_user:token" -X POST 'http://localhost:9000/api/templates' \
"updated_at": "2020-03-14T17:36:41.288578+01:00",
"name": "Default template",
"body": "{{ template \"content\" . }}",
+ "body_source": null,
"type": "campaign",
"is_default": true
}
@@ -192,6 +196,7 @@ curl -u "api_user:token" -X PUT 'http://localhost:9000/api/templates/1/default'
"updated_at": "2020-03-14T17:36:41.288578+01:00",
"name": "Default template",
"body": "{{ template \"content\" . }}",
+ "body_source": null,
"type": "campaign",
"is_default": true
}
diff --git a/docs/docs/content/roles-and-permissions.md b/docs/docs/content/roles-and-permissions.md
index 5f17aa00..62ab21a7 100644
--- a/docs/docs/content/roles-and-permissions.md
+++ b/docs/docs/content/roles-and-permissions.md
@@ -6,7 +6,7 @@ A user role is a collection of user related permissions. User roles are attached
| Group | Permission | Description |
| ----------- | ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
-| lists | lists:get_all | Get details of all lists |
+| lists | lists:get_all | Get details of all lists |
| | lists:manage_all | Create, update, and delete all lists |
| subscribers | subscribers:get | Get individual subscriber details |
| | subscribers:get_all | Get all subscribers and their details |
@@ -14,7 +14,8 @@ A user role is a collection of user related permissions. User roles are attached
| | subscribers:import | Import subscribers from external files |
| | subscribers:sql_query | Run SQL queries on subscriber data. **WARNING:** This permission will allow the querying of all lists and subscribers directly from the database with SQL expressions, superceding individual list and subscriber permissions above. |
| | tx:send | Send transactional messages to subscribers |
-| campaigns | campaigns:get | Get campaign details |
+| campaigns | campaigns:get | Get and view campaigns belonging to permitted lists |
+| | campaigns:get_all | Get and view campaigns across all lists |
| | campaigns:get_analytics | Access campaign performance metrics |
| | campaigns:manage | Create, update, and delete campaigns |
| bounces | bounces:get | Get email bounce records |