Fix typos in comments (#1368)
Co-authored-by: Yatish Mehta <yatish@example.com>
This commit is contained in:
parent
f94c1f34b6
commit
530165f5ee
10 changed files with 100 additions and 100 deletions
|
@ -1,16 +1,16 @@
|
||||||
# API / Campaigns
|
# API / Campaigns
|
||||||
|
|
||||||
Method | Endpoint | Description
|
Method | Endpoint | Description
|
||||||
-------|---------------------------------------------------------------------------|-----------------------------
|
---------|------------------------------------------------------------------------------|-------------------------------------------------------------
|
||||||
`GET` | [/api/campaigns](#get-apicampaigns) | Gets all campaigns.
|
`GET` | [/api/campaigns](#get-apicampaigns) | Gets all campaigns.
|
||||||
`GET` | [/api/campaigns/:`campaign_id`](#get-apicampaignscampaign_id) | Gets a single campaign.
|
`GET` | [/api/campaigns/:`campaign_id`](#get-apicampaignscampaign_id) | Gets a single campaign.
|
||||||
`GET` | [/api/campaigns/:`campaign_id`/preview](#get-apicampaignscampaign_idpreview) | Gets the HTML preview of a campaign body.
|
`GET` | [/api/campaigns/:`campaign_id`/preview](#get-apicampaignscampaign_idpreview) | Gets the HTML preview of a campaign body.
|
||||||
`GET` | [/api/campaigns/running/stats](#get-apicampaignsrunningstats) | Gets the stats of a given set of campaigns.
|
`GET` | [/api/campaigns/running/stats](#get-apicampaignsrunningstats) | Gets the stats of a given set of campaigns.
|
||||||
`POST` | [/api/campaigns](#post-apicampaigns) | Creates a new campaign.
|
`POST` | [/api/campaigns](#post-apicampaigns) | Creates a new campaign.
|
||||||
`POST` | /api/campaigns/:`campaign_id`/test | Posts campaign message to arbitrary subscribers for testing.
|
`POST` | /api/campaigns/:`campaign_id`/test | Posts campaign message to arbitrary subscribers for testing.
|
||||||
`PUT` | /api/campaigns/:`campaign_id` | Modifies a campaign.
|
`PUT` | /api/campaigns/:`campaign_id` | Modifies a campaign.
|
||||||
`PUT` | [/api/campaigns/:`campaign_id`/status](#put-apicampaignscampaign_idstatus) | Start / pause / cancel / schedule a campaign.
|
`PUT` | [/api/campaigns/:`campaign_id`/status](#put-apicampaignscampaign_idstatus) | Start / pause / cancel / schedule a campaign.
|
||||||
`DELETE` | [/api/campaigns/:`campaign_id`](#delete-apicampaignscampaign_id) | Deletes a campaign.
|
`DELETE` | [/api/campaigns/:`campaign_id`](#delete-apicampaignscampaign_id) | Deletes a campaign.
|
||||||
|
|
||||||
#### ```GET``` /api/campaigns
|
#### ```GET``` /api/campaigns
|
||||||
|
|
||||||
|
@ -83,9 +83,9 @@ Name | Type | Required/Optional | Description
|
||||||
Gets a single campaign.
|
Gets a single campaign.
|
||||||
|
|
||||||
##### Parameters
|
##### Parameters
|
||||||
Name | Parameter Type | Data Type | Required/Optional | Description
|
Name | Parameter Type | Data Type | Required/Optional | Description
|
||||||
------------|-------------------|--------------|----------------------|-----------------------------
|
--------------|----------------|-----------|-------------------|-----------------------------------------------
|
||||||
`campaign_id` | Path Parameter | Number | Required | The id value of the campaign you want to get.
|
`campaign_id` | Path Parameter | Number | Required | The id value of the campaign you want to get.
|
||||||
|
|
||||||
|
|
||||||
##### Example Request
|
##### Example Request
|
||||||
|
@ -142,9 +142,9 @@ Gets the html preview of a campaign body.
|
||||||
|
|
||||||
##### Parameters
|
##### Parameters
|
||||||
|
|
||||||
Name | Parameter Type | Data Type | Required/Optional | Description
|
Name | Parameter Type | Data Type | Required/Optional | Description
|
||||||
------------|-------------------|--------------|----------------------|-----------------------------
|
--------------|----------------|-----------|-------------------|----------------------------------------------
|
||||||
`campaign_id` | Path Parameter | Number | Required | The id value of the campaign to be previewed.
|
`campaign_id` | Path Parameter | Number | Required | The id value of the campaign to be previewed.
|
||||||
|
|
||||||
|
|
||||||
##### Example Request
|
##### Example Request
|
||||||
|
@ -166,9 +166,9 @@ Gets the running stat of a given set of campaigns.
|
||||||
|
|
||||||
##### Parameters
|
##### Parameters
|
||||||
|
|
||||||
Name | Parameter Type | Data Type | Required/Optional | Description
|
Name | Parameter Type | Data Type | Required/Optional | Description
|
||||||
------------|------------------|------------|---------------------|--------------------------------
|
------------|------------------|-----------|-------------------|-----------------------------------------------------------
|
||||||
campaign_id | Query Parameters | Number | Required | The id values of the campaigns whose stat you want to get.
|
campaign_id | Query Parameters | Number | Required | The id values of the campaigns whose stat you want to get.
|
||||||
|
|
||||||
|
|
||||||
##### Example Request
|
##### Example Request
|
||||||
|
@ -259,10 +259,10 @@ Modifies a campaign status to start, pause, cancel, or schedule a campaign.
|
||||||
|
|
||||||
##### Parameters
|
##### Parameters
|
||||||
|
|
||||||
Name | Parameter Type | Data Type | Required/Optional | Description
|
Name | Parameter Type | Data Type | Required/Optional | Description
|
||||||
------------------|-------------------------|---------------------------|----------------------|-----------------------------
|
--------------|----------------|-----------|-------------------|-------------------------------------------------------------
|
||||||
`campaign_id` | Path Parameter | Number | Required | The id value of the campaign whose status is to be modified.
|
`campaign_id` | Path Parameter | Number | Required | The id value of the campaign whose status is to be modified.
|
||||||
`status` | Request Body | String | Required | `scheduled`, `running`, `paused`, `cancelled`.
|
`status` | Request Body | String | Required | `scheduled`, `running`, `paused`, `cancelled`.
|
||||||
|
|
||||||
|
|
||||||
###### Note:
|
###### Note:
|
||||||
|
@ -324,9 +324,9 @@ Deletes a campaign, only scheduled campaigns that have not yet been started can
|
||||||
|
|
||||||
##### Parameters
|
##### Parameters
|
||||||
|
|
||||||
Name | Parameter Type | Data Type | Required/Optional | Description
|
Name | Parameter Type | Data Type | Required/Optional | Description
|
||||||
---------|--------------------|----------------|---------------------|------------------------------
|
--------------|----------------|-----------|-------------------|-------------------------------------------------
|
||||||
`campaign_id`| Path Parameter | Number | Required | The id value of the campaign you want to delete.
|
`campaign_id` | Path Parameter | Number | Required | The id value of the campaign you want to delete.
|
||||||
|
|
||||||
|
|
||||||
##### Example Request
|
##### Example Request
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
# API / Import
|
# API / Import
|
||||||
|
|
||||||
Method | Endpoint | Description
|
Method | Endpoint | Description
|
||||||
-----------|----------------------------------------------------------------------|--------------
|
---------|--------------------------------------------------------------|----------------------------------------------------------
|
||||||
`GET` | [api/import/subscribers](#get-apiimportsubscribers) | Gets a import statistics.
|
`GET` | [api/import/subscribers](#get-apiimportsubscribers) | Gets a import statistics.
|
||||||
`GET` | [api/import/subscribers/logs](#get-apiimportsubscriberslogs) | Get a import statistics .
|
`GET` | [api/import/subscribers/logs](#get-apiimportsubscriberslogs) | Get a import statistics .
|
||||||
`POST` | [api/import/subscribers](#post-apiimportsubscribers) | Upload a ZIP file or CSV file to bulk import subscribers.
|
`POST` | [api/import/subscribers](#post-apiimportsubscribers) | Upload a ZIP file or CSV file to bulk import subscribers.
|
||||||
`DELETE` | [api/import/subscribers](#delete-apiimportsubscribers) | Stops and deletes a import.
|
`DELETE` | [api/import/subscribers](#delete-apiimportsubscribers) | Stops and deletes a import.
|
||||||
|
|
||||||
|
|
||||||
#### **`GET`** api/import/subscribers
|
#### **`GET`** api/import/subscribers
|
||||||
|
@ -51,10 +51,10 @@ Post a CSV (optionally zipped) file to do a bulk import. The request should be a
|
||||||
|
|
||||||
##### Parameters
|
##### Parameters
|
||||||
|
|
||||||
Name | Parameter type | Data type | Required/Optional | Description
|
Name | Parameter type | Data type | Required/Optional | Description
|
||||||
---------|----------------|----------------|-------------------|-----------------------
|
---------|----------------|-----------|-------------------|------------------------------------
|
||||||
`params` | Request body | String | Required | Stringified JSON with import params
|
`params` | Request body | String | Required | Stringified JSON with import params
|
||||||
`file` | Request body | File | Required | File to upload
|
`file` | Request body | File | Required | File to upload
|
||||||
|
|
||||||
***params*** (JSON string)
|
***params*** (JSON string)
|
||||||
|
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
# API / Media
|
# API / Media
|
||||||
Method | Endpoint | Description
|
Method | Endpoint | Description
|
||||||
--------------|--------------------------------------------------------------|----------------------------------------------
|
---------|----------------------------------------------------|------------------------------
|
||||||
`GET` | [/api/media](#get-apimedia) | Gets an uploaded media file.
|
`GET` | [/api/media](#get-apimedia) | Gets an uploaded media file.
|
||||||
`POST` | [/api/media](#post-apimedia) | Uploads a media file.
|
`POST` | [/api/media](#post-apimedia) | Uploads a media file.
|
||||||
`DELETE` | [/api/media/:`media_id`](#delete-apimediamedia_id) | Deletes uploaded media files.
|
`DELETE` | [/api/media/:`media_id`](#delete-apimediamedia_id) | Deletes uploaded media files.
|
||||||
|
|
||||||
#### **`GET`** /api/media
|
#### **`GET`** /api/media
|
||||||
Gets an uploaded media file.
|
Gets an uploaded media file.
|
||||||
|
@ -33,23 +33,23 @@ curl -u "username:username" -X GET 'http://localhost:9000/api/media' \
|
||||||
Response definitions
|
Response definitions
|
||||||
The following table describes each item in the response.
|
The following table describes each item in the response.
|
||||||
|
|
||||||
|Response item |Description |Data type |
|
| Response item | Description | Data type |
|
||||||
|:---------------:|:------------|:----------:|
|
|:-------------:|:----------------------------------------------------------------------------------------------|:----------------------:|
|
||||||
|data|Array of the media file objects, which contains an information about the uploaded media files|array|
|
| data | Array of the media file objects, which contains an information about the uploaded media files | array |
|
||||||
|id|Media file object ID|number (int)|
|
| id | Media file object ID | number (int) |
|
||||||
|uuid|Media file uuuid|string (uuid)|
|
| uuid | Media file uuid | string (uuid) |
|
||||||
|filename|Name of the media file|string|
|
| filename | Name of the media file | string |
|
||||||
|created_at|Date and time, when the media file object was created|String (localDateTime)|
|
| created_at | Date and time, when the media file object was created | String (localDateTime) |
|
||||||
|thumb_uri|The thumbnail URI of the media file|string|
|
| thumb_uri | The thumbnail URI of the media file | string |
|
||||||
|uri|URI of the media file|string|
|
| uri | URI of the media file | string |
|
||||||
|
|
||||||
#### **`POST`** /api/media
|
#### **`POST`** /api/media
|
||||||
Uploads a media file.
|
Uploads a media file.
|
||||||
|
|
||||||
##### Parameters
|
##### Parameters
|
||||||
Nam | Parameter Type | Data Type | Required/Optional | Description
|
Name | Parameter Type | Data Type | Required/Optional | Description
|
||||||
-----------|-----------------------|-------------------|-------------------------|---------------------------------
|
-----|----------------|------------|-------------------|-------------------------------
|
||||||
file | Request body | Media file | Required | The media file to be uploaded.
|
file | Request body | Media file | Required | The media file to be uploaded.
|
||||||
|
|
||||||
|
|
||||||
##### Example Request
|
##### Example Request
|
||||||
|
@ -74,17 +74,17 @@ curl -u "username:username" -X POST 'http://localhost:9000/api/media' \
|
||||||
```
|
```
|
||||||
Response definitions
|
Response definitions
|
||||||
|
|
||||||
|Response item |Description |Data type |
|
| Response item | Description | Data type |
|
||||||
|:---------------:|:------------:|:----------:|
|
|:-------------:|:--------------------------------------------------------:|:---------:|
|
||||||
|data|True means that the media file was successfully uploaded |boolean|
|
| data | True means that the media file was successfully uploaded | boolean |
|
||||||
|
|
||||||
#### **`DELETE`** /api/media/:`media_id`
|
#### **`DELETE`** /api/media/:`media_id`
|
||||||
Deletes an uploaded media file.
|
Deletes an uploaded media file.
|
||||||
|
|
||||||
##### Parameters
|
##### Parameters
|
||||||
Name | Parameter Type | Data Type | Required/Optional | Description
|
Name | Parameter Type | Data Type | Required/Optional | Description
|
||||||
----------------|-------------------------|--------------------|-------------------------|--------------------------
|
-----------|----------------|-----------|-------------------|---------------------------------------------
|
||||||
`Media_id` | Path Parameter | Number | Required | The id of the media file you want to delete.
|
`Media_id` | Path Parameter | Number | Required | The id of the media file you want to delete.
|
||||||
|
|
||||||
|
|
||||||
##### Example Request
|
##### Example Request
|
||||||
|
@ -102,6 +102,6 @@ curl -u "username:username" -X DELETE 'http://localhost:9000/api/media/1'
|
||||||
|
|
||||||
Response definitions
|
Response definitions
|
||||||
|
|
||||||
|Response item |Description |Data type |
|
| Response item | Description | Data type |
|
||||||
|:---------------:|:------------:|:----------:|
|
|:-------------:|:-------------------------------------------------------:|:---------:|
|
||||||
|data|True means that the media file was successfully deleted |boolean|
|
| data | True means that the media file was successfully deleted | boolean |
|
||||||
|
|
|
@ -283,12 +283,12 @@ Creates a new subscriber.
|
||||||
|
|
||||||
Name | Parameter type | Data type | Required/Optional | Description
|
Name | Parameter type | Data type | Required/Optional | Description
|
||||||
-------------------------|------------------|------------|-------------------|----------------------------
|
-------------------------|------------------|------------|-------------------|----------------------------
|
||||||
email | Request body | String | Required | The email address of the new susbcriber.
|
email | Request body | String | Required | The email address of the new subscriber.
|
||||||
name | Request body | String | Required | The name of the new subscriber.
|
name | Request body | String | Required | The name of the new subscriber.
|
||||||
status | Request body | String | Required | The status of the new subscriber. Can be enabled, disabled or blocklisted.
|
status | Request body | String | Required | The status of the new subscriber. Can be enabled, disabled or blocklisted.
|
||||||
lists | Request body | Numbers | Optional | Array of list IDs to subscribe to (marked as `unconfirmed` by default).
|
lists | Request body | Numbers | Optional | Array of list IDs to subscribe to (marked as `unconfirmed` by default).
|
||||||
attribs | Request body | json | Optional | JSON list containing new subscriber's attributes.
|
attribs | Request body | json | Optional | JSON list containing new subscriber's attributes.
|
||||||
preconfirm_subscriptions | Request body | Bool | Optional | If `true`, marks subscriptsions as `confirmed` and no-optin e-mails are sent for double opt-in lists.
|
preconfirm_subscriptions | Request body | Bool | Optional | If `true`, marks subscriptions as `confirmed` and no-optin e-mails are sent for double opt-in lists.
|
||||||
|
|
||||||
##### Example Request
|
##### Example Request
|
||||||
```shell
|
```shell
|
||||||
|
@ -325,12 +325,12 @@ Modify subscribers list memberships.
|
||||||
|
|
||||||
##### Parameters
|
##### Parameters
|
||||||
|
|
||||||
Name | Paramter type | Data type | Required/Optional | Description
|
Name | Parameter type | Data type | Required/Optional | Description
|
||||||
------------------|---------------|-----------|--------------------|-------------------------------------------------------
|
------------------|----------------|-----------|--------------------|-------------------------------------------------------
|
||||||
`ids` | Request body | Numbers | Required | The ids of the subscribers to be modified.
|
`ids` | Request body | Numbers | Required | The ids of the subscribers to be modified.
|
||||||
`action` | Request body | String | Required | Wether to `add`, `remove`, or `unsubscribe` the users.
|
`action` | Request body | String | Required | Whether to `add`, `remove`, or `unsubscribe` the users.
|
||||||
`target_list_ids` | Request body | Numbers | Required | The ids of the lists to be modified.
|
`target_list_ids` | Request body | Numbers | Required | The ids of the lists to be modified.
|
||||||
`status` | Request body | String | Required for `add` | `confirmed`, `unconfirmed`, or `unsubscribed` status.
|
`status` | Request body | String | Required for `add` | `confirmed`, `unconfirmed`, or `unsubscribed` status.
|
||||||
|
|
||||||
##### Example Request
|
##### Example Request
|
||||||
|
|
||||||
|
|
|
@ -1,15 +1,15 @@
|
||||||
# API / Templates
|
# API / Templates
|
||||||
|
|
||||||
Method | Endpoint | Description
|
Method | Endpoint | Description
|
||||||
---------------------|-----------------------------------------|-----------------------------------------------------
|
---------|------------------------------------------------------------------------------|-----------------------------------------
|
||||||
`GET` | [/api/templates](#get-apitemplates) | Gets all templates.
|
`GET` | [/api/templates](#get-apitemplates) | Gets all templates.
|
||||||
`GET` | [/api/templates/:`template_id`](#get-apitemplatestemplate_id) | Gets a single template.
|
`GET` | [/api/templates/:`template_id`](#get-apitemplatestemplate_id) | Gets a single template.
|
||||||
`GET` | [/api/templates/:`template_id`/preview](#get-apitemplatestemplate_idpreview) | Gets the HTML preview of a template.
|
`GET` | [/api/templates/:`template_id`/preview](#get-apitemplatestemplate_idpreview) | Gets the HTML preview of a template.
|
||||||
`POST` | /api/templates/preview |
|
`POST` | /api/templates/preview |
|
||||||
`POST` | /api/templates | Creates a template.
|
`POST` | /api/templates | Creates a template.
|
||||||
`PUT` | /api/templates/:`template_id` | Modifies a template.
|
`PUT` | /api/templates/:`template_id` | Modifies a template.
|
||||||
`PUT` | [/api/templates/:`template_id`/default](#put-apitemplatestemplate_iddefault) | Sets a template to the default template.
|
`PUT` | [/api/templates/:`template_id`/default](#put-apitemplatestemplate_iddefault) | Sets a template to the default template.
|
||||||
`DELETE` | [/api/templates/:`template_id`](#delete-apitemplatestemplate_id) | Deletes a template.
|
`DELETE` | [/api/templates/:`template_id`](#delete-apitemplatestemplate_id) | Deletes a template.
|
||||||
|
|
||||||
#### **`GET`** /api/templates
|
#### **`GET`** /api/templates
|
||||||
Gets all templates.
|
Gets all templates.
|
||||||
|
@ -40,9 +40,9 @@ Gets all templates.
|
||||||
Gets a single template.
|
Gets a single template.
|
||||||
|
|
||||||
##### Parameters
|
##### Parameters
|
||||||
Name | Parameter Type | Data Type | Required/Optional | Description
|
Name | Parameter Type | Data Type | Required/Optional | Description
|
||||||
------------|------------------------|---------------------|-------------------------|------------------------------------------
|
--------------|----------------|-----------|-------------------|----------------------------------------------
|
||||||
`template_id` | Path Parameter | Number | Required | The id value of the template you want to get.
|
`template_id` | Path Parameter | Number | Required | The id value of the template you want to get.
|
||||||
|
|
||||||
##### Example Request
|
##### Example Request
|
||||||
``` shell
|
``` shell
|
||||||
|
@ -68,9 +68,9 @@ curl -u "username:username" -X GET 'http://localhost:9000/api/templates/1'
|
||||||
Gets the HTML preview of a template body.
|
Gets the HTML preview of a template body.
|
||||||
|
|
||||||
##### Parameters
|
##### Parameters
|
||||||
Name | Parameter Type | Data Type | Required/Optional | Description
|
Name | Parameter Type | Data Type | Required/Optional | Description
|
||||||
------------|----------------------|-----------------|------------------------|---------------------------------
|
--------------|----------------|------------|-------------------|-----------------------------------------------------------------
|
||||||
`template_id` | Path Parameter | Number | Required | The id value of the template whose html preview you want to get.
|
`template_id` | Path Parameter | Number | Required | The id value of the template whose html preview you want to get.
|
||||||
|
|
||||||
##### Example Request
|
##### Example Request
|
||||||
``` shell
|
``` shell
|
||||||
|
@ -97,9 +97,9 @@ curl -u "username:username" -X GET 'http://localhost:9000/api/templates/1/previe
|
||||||
Sets a template to the default template.
|
Sets a template to the default template.
|
||||||
|
|
||||||
##### Parameters
|
##### Parameters
|
||||||
Name | Parameter Type | Data Type | Required/Optional | Description
|
Name | Parameter Type | Data Type | Required/Optional | Description
|
||||||
------------|------------------------|---------------------|-------------------------|------------------------------------------
|
--------------|----------------|-----------|-------------------|----------------------------------------------------------------------
|
||||||
`template_id` | Path Parameter | Number | Required | The id value of the template you want to set to the default template.
|
`template_id` | Path Parameter | Number | Required | The id value of the template you want to set to the default template.
|
||||||
|
|
||||||
|
|
||||||
##### Example Request
|
##### Example Request
|
||||||
|
@ -127,9 +127,9 @@ curl -u "username:username" -X PUT 'http://localhost:9000/api/templates/1/defaul
|
||||||
Deletes a template.
|
Deletes a template.
|
||||||
|
|
||||||
##### Parameters
|
##### Parameters
|
||||||
Name | Parameter Type | Data Type | Required/Optional | Description
|
Name | Parameter Type | Data Type | Required/Optional | Description
|
||||||
------------|------------------------|---------------------|-------------------------|------------------------------------------
|
--------------|----------------|-----------|-------------------|-------------------------------------------------
|
||||||
`template_id` | Path Parameter | Number | Required | The id value of the template you want to delete.
|
`template_id` | Path Parameter | Number | Required | The id value of the template you want to delete.
|
||||||
|
|
||||||
|
|
||||||
##### Example Request
|
##### Example Request
|
||||||
|
|
|
@ -47,7 +47,7 @@ func New(o Opt) *Captcha {
|
||||||
}}
|
}}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Verify veries a CAPTCHA request.
|
// Verify verifies a CAPTCHA request.
|
||||||
func (c *Captcha) Verify(token string) (error, bool) {
|
func (c *Captcha) Verify(token string) (error, bool) {
|
||||||
resp, err := c.client.PostForm(rootURL, url.Values{
|
resp, err := c.client.PostForm(rootURL, url.Values{
|
||||||
"secret": {c.o.CaptchaSecret},
|
"secret": {c.o.CaptchaSecret},
|
||||||
|
|
|
@ -65,7 +65,7 @@ func (c *Core) GetCampaign(id int, uuid string) (models.Campaign, error) {
|
||||||
return c.getCampaign(id, uuid, campaignTplDefault)
|
return c.getCampaign(id, uuid, campaignTplDefault)
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetArchivedCampaign retreives a campaign with the archive template body.
|
// GetArchivedCampaign retrieves a campaign with the archive template body.
|
||||||
func (c *Core) GetArchivedCampaign(id int, uuid string) (models.Campaign, error) {
|
func (c *Core) GetArchivedCampaign(id int, uuid string) (models.Campaign, error) {
|
||||||
out, err := c.getCampaign(id, uuid, campaignTplArchive)
|
out, err := c.getCampaign(id, uuid, campaignTplArchive)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
|
@ -439,7 +439,7 @@ func (c *Core) DeleteSubscribersByQuery(query string, listIDs []int) error {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
// UnsubscribeByCampaign unsubscibers a given subscriber from lists in a given campaign.
|
// UnsubscribeByCampaign unsubscribes a given subscriber from lists in a given campaign.
|
||||||
func (c *Core) UnsubscribeByCampaign(subUUID, campUUID string, blocklist bool) error {
|
func (c *Core) UnsubscribeByCampaign(subUUID, campUUID string, blocklist bool) error {
|
||||||
if _, err := c.q.UnsubscribeByCampaign.Exec(campUUID, subUUID, blocklist); err != nil {
|
if _, err := c.q.UnsubscribeByCampaign.Exec(campUUID, subUUID, blocklist); err != nil {
|
||||||
c.log.Printf("error unsubscribing: %v", err)
|
c.log.Printf("error unsubscribing: %v", err)
|
||||||
|
|
|
@ -90,7 +90,7 @@ func (c *Core) UnsubscribeLists(subIDs, listIDs []int, listUUIDs []string) error
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// UnsubscribeListsByQuery sets list subscriptions to 'ubsubscribed' by a given arbitrary query expression.
|
// UnsubscribeListsByQuery sets list subscriptions to 'unsubscribed' by a given arbitrary query expression.
|
||||||
// sourceListIDs is the list of list IDs to filter the subscriber query with.
|
// sourceListIDs is the list of list IDs to filter the subscriber query with.
|
||||||
func (c *Core) UnsubscribeListsByQuery(query string, sourceListIDs, targetListIDs []int) error {
|
func (c *Core) UnsubscribeListsByQuery(query string, sourceListIDs, targetListIDs []int) error {
|
||||||
if sourceListIDs == nil {
|
if sourceListIDs == nil {
|
||||||
|
@ -99,7 +99,7 @@ func (c *Core) UnsubscribeListsByQuery(query string, sourceListIDs, targetListID
|
||||||
|
|
||||||
err := c.q.ExecSubQueryTpl(sanitizeSQLExp(query), c.q.UnsubscribeSubscribersFromListsByQuery, sourceListIDs, c.db, pq.Array(targetListIDs))
|
err := c.q.ExecSubQueryTpl(sanitizeSQLExp(query), c.q.UnsubscribeSubscribersFromListsByQuery, sourceListIDs, c.db, pq.Array(targetListIDs))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
c.log.Printf("error unsubscriging from lists by query: %v", err)
|
c.log.Printf("error unsubscribing from lists by query: %v", err)
|
||||||
return echo.NewHTTPError(http.StatusInternalServerError,
|
return echo.NewHTTPError(http.StatusInternalServerError,
|
||||||
c.i18n.Ts("globals.messages.errorUpdating", "name", "{globals.terms.subscribers}", "error", pqErrMsg(err)))
|
c.i18n.Ts("globals.messages.errorUpdating", "name", "{globals.terms.subscribers}", "error", pqErrMsg(err)))
|
||||||
}
|
}
|
||||||
|
@ -107,7 +107,7 @@ func (c *Core) UnsubscribeListsByQuery(query string, sourceListIDs, targetListID
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// DeleteUnconfirmedSubscriptions sets list subscriptions to 'ubsubscribed' by a given arbitrary query expression.
|
// DeleteUnconfirmedSubscriptions sets list subscriptions to 'unsubscribed' by a given arbitrary query expression.
|
||||||
// sourceListIDs is the list of list IDs to filter the subscriber query with.
|
// sourceListIDs is the list of list IDs to filter the subscriber query with.
|
||||||
func (c *Core) DeleteUnconfirmedSubscriptions(beforeDate time.Time) (int, error) {
|
func (c *Core) DeleteUnconfirmedSubscriptions(beforeDate time.Time) (int, error) {
|
||||||
res, err := c.q.DeleteUnconfirmedSubscriptions.Exec(beforeDate)
|
res, err := c.q.DeleteUnconfirmedSubscriptions.Exec(beforeDate)
|
||||||
|
|
|
@ -145,7 +145,7 @@ func New(opt Options, db *sql.DB, i *i18n.I18n) *Importer {
|
||||||
im.domainBlocklist[d] = true
|
im.domainBlocklist[d] = true
|
||||||
|
|
||||||
// Domains with *. as the subdomain prefix, strip that
|
// Domains with *. as the subdomain prefix, strip that
|
||||||
// and add the full domain to the blocklist as welll.
|
// and add the full domain to the blocklist as well.
|
||||||
// eg: *.example.com => example.com
|
// eg: *.example.com => example.com
|
||||||
if strings.Contains(d, "*.") {
|
if strings.Contains(d, "*.") {
|
||||||
im.hasBlocklistWildcards = true
|
im.hasBlocklistWildcards = true
|
||||||
|
|
Loading…
Reference in a new issue