Fix typos in comments (#1368)

Co-authored-by: Yatish Mehta <yatish@example.com>
This commit is contained in:
Yatish Mehta 2023-06-20 11:10:34 -07:00 committed by GitHub
parent f94c1f34b6
commit 530165f5ee
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 100 additions and 100 deletions

View file

@ -1,7 +1,7 @@
# 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.
@ -84,7 +84,7 @@ 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.
@ -143,7 +143,7 @@ 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.
@ -167,7 +167,7 @@ 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.
@ -260,7 +260,7 @@ 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`.
@ -325,7 +325,7 @@ 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.

View file

@ -1,7 +1,7 @@
# 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.
@ -52,7 +52,7 @@ 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

View file

@ -1,6 +1,6 @@
# 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.
@ -34,10 +34,10 @@ 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 |
@ -47,8 +47,8 @@ The following table describes each item in the response.
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.
@ -75,7 +75,7 @@ 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`
@ -83,7 +83,7 @@ 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.
@ -103,5 +103,5 @@ 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 |

View file

@ -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,10 +325,10 @@ 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.

View file

@ -1,7 +1,7 @@
# 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.
@ -41,7 +41,7 @@ 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
@ -69,7 +69,7 @@ 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
@ -98,7 +98,7 @@ 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.
@ -128,7 +128,7 @@ 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.

View file

@ -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},

View file

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

View file

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

View file

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

View file

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