Documentation
¶
Index ¶
- Constants
- Variables
- func Bool(v bool) *bool
- func Int(v int) *int
- func Int64(v int64) *int64
- func String(v string) *string
- type AbSettings
- type Aggregations
- type AuthError
- type Automation
- type AutomationEmailMeta
- type AutomationGroupMeta
- type AutomationService
- type AutomationStats
- type AutomationSubscriber
- type AutomationSubscriberMeta
- type BValue
- type BounceRate
- type Campaign
- type CampaignFilter
- type CampaignLanguage
- type CampaignService
- type CampaignSettings
- type CampaignSubscriber
- type Can
- type ClickRate
- type ClickToOpenRate
- type Client
- type Condition
- type ConversionRate
- type Count
- type Counts
- type CreateCampaign
- type CreateWebhookOptions
- type Email
- type Emails
- type ErrorResponse
- type Field
- type FieldService
- type Filter
- type Form
- type FormService
- type GetCampaignOptions
- type GetSubscriberOptions
- type Group
- type GroupService
- type HardBounceRate
- type Links
- type ListAutomationOptions
- type ListAutomationSubscriberOptions
- type ListCampaignOptions
- type ListCampaignSubscriberOptions
- type ListFieldOptions
- type ListFormOptions
- type ListFormSubscriberOptions
- type ListGroupOptions
- type ListGroupSubscriberOptions
- type ListSegmentOptions
- type ListSegmentSubscriberOptions
- type ListSubscriberOptions
- type ListWebhookOptions
- type Meta
- type MetaLinks
- type OpenRate
- type Rate
- type RateLimitError
- type Resend
- type ResendSettings
- type Response
- type RootAutomation
- type RootAutomations
- type RootAutomationsSubscriber
- type RootCampaign
- type RootCampaignLanguages
- type RootCampaignSubscribers
- type RootCampaigns
- type RootField
- type RootFields
- type RootForm
- type RootForms
- type RootGroup
- type RootGroups
- type RootSegment
- type RootSegments
- type RootSubscriber
- type RootSubscribers
- type RootTimezones
- type RootWebhook
- type RootWebhooks
- type Schedule
- type ScheduleCampaign
- type Segment
- type SegmentService
- type SoftBounceRate
- type SpamRate
- type Stats
- type Step
- type StepRun
- type Subscriber
- type SubscriberService
- type Timezone
- type TimezoneService
- type TriggerData
- type Triggers
- type UnsubscribeRate
- type UpdateCampaign
- type UpdateSubscriber
- type UpdateWebhookOptions
- type UpsertSubscriber
- type Webhook
- type WebhookService
Constants ¶
const ( Version = "0.0.2" APIVersion = "2023-18-04" HeaderAPIVersion = "X-Version" HeaderRateLimit = "X-RateLimit-Limit" HeaderRateRemaining = "X-RateLimit-Remaining" HeaderRateRetryAfter = "Retry-After" )
Variables ¶
var ( SortByID = "id" SortByIDDescending = "-id" SortByName = "name" SortByNameDescending = "-name" SortByType = "type" SortByTypeDescending = "-type" SortByTotal = "total" SortByTotalDescending = "-total" SortByOpenRate = "open_rate" SortByOpenRateDescending = "-open_rate" SortByClickRate = "click_rate" SortByClickRateDescending = "-click_rate" SortByConversionsCount = "conversions_count" SortByConversionsCountDescending = "-conversions_count" SortByConversionRate = "conversion_rate" SortByConversionRateDescending = "-conversion_rate" SortByClicksCount = "clicks_count" SortByClicksCountDescending = "-clicks_count" SortByOpensCount = "opens_count" SortByOpensCountDescending = "-opens_count" SortByVisitors = "visitors" SortByVisitorsDescending = "-visitors" SortByLastRegistrationAt = "last_registration_at" SortByLastRegistrationAtDescending = "-created_at" SortByCreatedAt = "created_at" SortByCreatedAtDescending = "-created_at" SortByUpdatedAt = "updated_at" SortByUpdatedAtDescending = "-updated_at" FormTypePopup = "popup" FormTypeEmbedded = "embedded" FormTypePromotion = "promotion" CampaignTypeRegular = "regular" CampaignTypeAB = "ab" CampaignTypeResend = "resend" CampaignScheduleTypeInstant = "instant" CampaignScheduleTypeScheduled = "scheduled" CampaignScheduleTypeTimezone = "timezone_based" )
Functions ¶
func Bool ¶
Bool is a helper routine that allocates a new bool value to store v and returns a pointer to it.
func Int ¶
Int is a helper routine that allocates a new int value to store v and returns a pointer to it.
Types ¶
type AbSettings ¶
type Aggregations ¶
type Automation ¶
type Automation struct { ID string `json:"id"` Name string `json:"name"` Enabled bool `json:"enabled"` TriggerData TriggerData `json:"trigger_data"` Steps []Step `json:"steps"` Triggers []Triggers `json:"triggers"` Complete bool `json:"complete"` Broken bool `json:"broken"` Warnings []interface{} `json:"warnings"` EmailsCount int `json:"emails_count"` FirstEmailScreenshotURL interface{} `json:"first_email_screenshot_url"` Stats AutomationStats `json:"stats"` CreatedAt string `json:"created_at"` HasBannedContent bool `json:"has_banned_content"` QualifiedSubscribersCount int `json:"qualified_subscribers_count"` }
type AutomationEmailMeta ¶
type AutomationGroupMeta ¶
type AutomationService ¶
type AutomationService interface { List(ctx context.Context, options *ListAutomationOptions) (*RootAutomations, *Response, error) Get(ctx context.Context, automationID string) (*RootAutomation, *Response, error) Subscribers(ctx context.Context, options *ListAutomationSubscriberOptions) (*RootAutomationsSubscriber, *Response, error) }
AutomationService defines an interface for automation-related operations.
type AutomationStats ¶
type AutomationStats struct { CompletedSubscribersCount int `json:"completed_subscribers_count"` SubscribersInQueueCount int `json:"subscribers_in_queue_count"` BounceRate *BounceRate `json:"bounce_rate,omitempty"` ClickToOpenRate *ClickToOpenRate `json:"click_to_open_rate,omitempty"` Sent int `json:"sent"` OpensCount int `json:"opens_count"` UniqueOpensCount interface{} `json:"unique_opens_count"` OpenRate *OpenRate `json:"open_rate,omitempty"` ClicksCount int `json:"clicks_count"` UniqueClicksCount interface{} `json:"unique_clicks_count"` ClickRate *ClickRate `json:"click_rate,omitempty"` UnsubscribesCount int `json:"unsubscribes_count"` UnsubscribeRate *UnsubscribeRate `json:"unsubscribe_rate,omitempty"` SpamCount int `json:"spam_count"` SpamRate *SpamRate `json:"spam_rate,omitempty"` HardBouncesCount int `json:"hard_bounces_count"` HardBounceRate *HardBounceRate `json:"hard_bounce_rate,omitempty"` SoftBouncesCount int `json:"soft_bounces_count"` SoftBounceRate *SoftBounceRate `json:"soft_bounce_rate,omitempty"` }
type AutomationSubscriber ¶
type AutomationSubscriber struct { ID string `json:"id"` Status string `json:"status"` Date string `json:"date"` Reason interface{} `json:"reason"` ReasonDescription string `json:"reason_description"` Subscriber AutomationSubscriberMeta `json:"subscriber"` StepRuns []StepRun `json:"stepRuns"` NextStep Step `json:"nextStep"` CurrentStep Step `json:"currentStep"` }
type BounceRate ¶
type Campaign ¶
type Campaign struct { ID string `json:"id"` AccountID string `json:"account_id"` Name string `json:"name"` Type string `json:"type"` Status string `json:"status"` MissingData []interface{} `json:"missing_data"` Settings CampaignSettings `json:"settings"` Filter [][]CampaignFilter `json:"filter"` FilterForHumans [][]string `json:"filter_for_humans"` DeliverySchedule string `json:"delivery_schedule"` LanguageID string `json:"language_id"` CreatedAt string `json:"created_at"` UpdatedAt string `json:"updated_at"` ScheduledFor string `json:"scheduled_for"` QueuedAt string `json:"queued_at"` StartedAt string `json:"started_at"` FinishedAt string `json:"finished_at"` StoppedAt interface{} `json:"stopped_at"` DefaultEmailID string `json:"default_email_id"` Emails []Email `json:"emails"` UsedInAutomations bool `json:"used_in_automations"` TypeForHumans string `json:"type_for_humans"` Stats Stats `json:"stats"` IsStopped bool `json:"is_stopped"` HasWinner interface{} `json:"has_winner"` WinnerVersionForHuman interface{} `json:"winner_version_for_human"` WinnerSendingTimeForHumans interface{} `json:"winner_sending_time_for_humans"` WinnerSelectedManuallyAt interface{} `json:"winner_selected_manually_at"` UsesEcommerce bool `json:"uses_ecommerce"` UsesSurvey bool `json:"uses_survey"` CanBeScheduled bool `json:"can_be_scheduled"` Warnings []interface{} `json:"warnings"` InitialCreatedAt interface{} `json:"initial_created_at"` IsCurrentlySendingOut bool `json:"is_currently_sending_out"` }
type CampaignFilter ¶
type CampaignFilter struct { Operator string `json:"operator"` Args []interface{} `json:"args"` }
type CampaignLanguage ¶
type CampaignService ¶
type CampaignService interface { List(ctx context.Context, options *ListCampaignOptions) (*RootCampaigns, *Response, error) Get(ctx context.Context, campaignID string) (*RootCampaign, *Response, error) Create(ctx context.Context, campaign *CreateCampaign) (*RootCampaign, *Response, error) Update(ctx context.Context, campaignID string, campaign *UpdateCampaign) (*RootCampaign, *Response, error) Schedule(ctx context.Context, campaignID string, campaign *ScheduleCampaign) (*RootCampaign, *Response, error) Cancel(ctx context.Context, campaignID string) (*RootCampaign, *Response, error) Subscribers(ctx context.Context, options *ListCampaignSubscriberOptions) (*RootCampaignSubscribers, *Response, error) Languages(ctx context.Context) (*RootCampaignLanguages, *Response, error) Delete(ctx context.Context, campaignID string) (*Response, error) }
CampaignService defines an interface for campaign-related operations.
type CampaignSettings ¶
type CampaignSubscriber ¶
type CampaignSubscriber struct { ID string `json:"id"` OpensCount int `json:"opens_count"` ClicksCount int `json:"clicks_count"` Subscriber Subscriber `json:"subscriber"` }
type ClickToOpenRate ¶
type Client ¶
type Client struct { Subscriber SubscriberService // Subscriber service Group GroupService // Group service Field FieldService // Field service Form FormService // Form service Segment SegmentService // Segment service Webhook WebhookService // Webhook service Campaign CampaignService // Campaign service Automation AutomationService // Automation service Timezone TimezoneService // Timezone service // contains filtered or unexported fields }
Client - base api client
func (*Client) SetHttpClient ¶
SetHttpClient - Set the client if you want more control over the client implementation
type Condition ¶
type Condition struct { Type string `json:"type"` EmailID string `json:"email_id"` Action string `json:"action"` LinkID interface{} `json:"link_id"` Email AutomationEmailMeta `json:"email"` }
type ConversionRate ¶
type CreateCampaign ¶
type CreateCampaign struct { Name string `json:"name"` LanguageID int `json:"language_id,omitempty"` Type string `json:"type"` Emails []Emails `json:"emails"` Groups []string `json:"groups,omitempty"` Segments []string `json:"segments,omitempty"` AbSettings *AbSettings `json:"ab_settings,omitempty"` ResendSettings *ResendSettings `json:"resend_settings,omitempty"` }
CreateCampaign - modifies the behavior of campaignService.Create method
type CreateWebhookOptions ¶
type CreateWebhookOptions struct { Name string `json:"name,omitempty"` Events []string `json:"events"` Url string `json:"url"` }
CreateWebhookOptions - modifies the behavior of WebhookService.Create method
type Email ¶
type Email struct { ID string `json:"id"` AccountID string `json:"account_id"` EmailableID string `json:"emailable_id"` EmailableType string `json:"emailable_type"` Type string `json:"type"` From string `json:"from"` FromName string `json:"from_name"` Name string `json:"name"` Subject string `json:"subject"` PlainText string `json:"plain_text"` ScreenshotURL string `json:"screenshot_url"` PreviewURL string `json:"preview_url"` CreatedAt string `json:"created_at"` UpdatedAt string `json:"updated_at"` IsDesigned bool `json:"is_designed"` LanguageID float64 `json:"language_id"` IsWinner bool `json:"is_winner"` Stats Stats `json:"stats"` SendAfter interface{} `json:"send_after"` TrackOpens bool `json:"track_opens"` }
type ErrorResponse ¶
type ErrorResponse struct { Response *http.Response // HTTP response that caused this error Message string `json:"message"` // error message Errors map[string][]string `json:"errors"` }
ErrorResponse is a MailerLite API error response. This wraps the standard http.Response
func (*ErrorResponse) Error ¶
func (r *ErrorResponse) Error() string
type FieldService ¶
type FieldService interface { List(ctx context.Context, options *ListFieldOptions) (*RootFields, *Response, error) Create(ctx context.Context, fieldName, fieldType string) (*RootField, *Response, error) Update(ctx context.Context, fieldID, fieldName string) (*RootField, *Response, error) Delete(ctx context.Context, fieldID string) (*Response, error) }
FieldService defines an interface for field-related operations.
type Filter ¶
type Filter struct { // Name is the name of the field. Name string `json:"name"` // Value is the value which the entry should be filtered by. Value interface{} `json:"value"` }
Filter is one of the arguments which has a name and a value
type Form ¶
type Form struct { Id string `json:"id"` Type string `json:"type"` Slug string `json:"slug"` Name string `json:"name"` CreatedAt string `json:"created_at"` ConversionsCount int `json:"conversions_count"` ConversionsRate ConversionRate `json:"conversions_rate"` OpensCount int `json:"opens_count"` Settings map[string]interface{} `json:"settings"` LastRegistrationAt interface{} `json:"last_registration_at"` Active bool `json:"active"` IsBroken bool `json:"is_broken"` HasContent bool `json:"has_content"` Can Can `json:"can"` UsedInAutomations bool `json:"used_in_automations"` Warnings []interface{} `json:"warnings"` DoubleOptin interface{} `json:"double_optin"` ScreenshotUrl interface{} `json:"screenshot_url"` }
type FormService ¶
type FormService interface { List(ctx context.Context, options *ListFormOptions) (*RootForms, *Response, error) Get(ctx context.Context, formID string) (*RootForm, *Response, error) Update(ctx context.Context, formID, formName string) (*RootForm, *Response, error) Delete(ctx context.Context, formID string) (*Response, error) Subscribers(ctx context.Context, options *ListFormSubscriberOptions) (*RootSubscribers, *Response, error) }
FormService defines an interface for form-related operations.
type GetCampaignOptions ¶
type GetCampaignOptions struct {
ID int `json:"id,omitempty"`
}
GetCampaignOptions - modifies the behavior of campaignService.Get method
type GetSubscriberOptions ¶
type GetSubscriberOptions struct { SubscriberID string `json:"id,omitempty"` Email string `json:"email,omitempty"` }
GetSubscriberOptions - modifies the behavior of SubscriberService.Get method
type Group ¶
type Group struct { ID string `json:"id"` Name string `json:"name"` ActiveCount int `json:"active_count"` SentCount int `json:"sent_count"` OpensCount int `json:"opens_count"` OpenRate OpenRate `json:"open_rate"` ClicksCount int `json:"clicks_count"` ClickRate ClickRate `json:"click_rate"` UnsubscribedCount int `json:"unsubscribed_count"` UnconfirmedCount int `json:"unconfirmed_count"` BouncedCount int `json:"bounced_count"` JunkCount int `json:"junk_count"` CreatedAt string `json:"created_at"` }
type GroupService ¶
type GroupService interface { List(ctx context.Context, options *ListGroupOptions) (*RootGroups, *Response, error) Create(ctx context.Context, groupName string) (*RootGroup, *Response, error) Update(ctx context.Context, groupID string, groupName string) (*RootGroup, *Response, error) Delete(ctx context.Context, groupID string) (*Response, error) Subscribers(ctx context.Context, options *ListGroupSubscriberOptions) (*RootSubscribers, *Response, error) Assign(ctx context.Context, groupID, subscriberID string) (*RootGroup, *Response, error) UnAssign(ctx context.Context, groupID, subscriberID string) (*Response, error) }
GroupService defines an interface for group-related operations.
type HardBounceRate ¶
type Links ¶
type Links struct { First string `json:"first"` Last string `json:"last"` Prev string `json:"prev"` Next string `json:"next"` }
Links manages links that are returned along with a List
func (*Links) IsLastPage ¶
IsLastPage returns true if the current page is the last
func (*Links) NextPageToken ¶
NextPageToken is the page token to request the next page of the list
func (*Links) PrevPageToken ¶
PrevPageToken is the page token to request the previous page of the list
type ListAutomationOptions ¶
type ListAutomationOptions struct { Filters *[]Filter `json:"filters,omitempty"` Page int `url:"page,omitempty"` Limit int `url:"limit,omitempty"` }
ListAutomationOptions - modifies the behavior of AutomationService.List method
type ListAutomationSubscriberOptions ¶
type ListAutomationSubscriberOptions struct { AutomationID string `url:"-"` Filters *[]Filter `json:"filters,omitempty"` Page int `url:"page,omitempty"` Limit int `url:"limit,omitempty"` }
ListAutomationSubscriberOptions - modifies the behavior of AutomationService.Subscribers method
type ListCampaignOptions ¶
type ListCampaignOptions struct { Filters *[]Filter `json:"filters,omitempty"` Page int `url:"page,omitempty"` Limit int `url:"limit,omitempty"` }
ListCampaignOptions - modifies the behavior of campaignService.List method
type ListFieldOptions ¶
type ListFieldOptions struct { Filters *[]Filter `json:"filters,omitempty"` Page int `url:"page,omitempty"` Limit int `url:"limit,omitempty"` Sort string `url:"sort,omitempty"` }
ListFieldOptions - modifies the behavior of FieldService.List method
type ListFormOptions ¶
type ListFormOptions struct { Type string `url:"-"` Filters *[]Filter `json:"filters,omitempty"` Page int `url:"page,omitempty"` Limit int `url:"limit,omitempty"` Sort string `url:"sort,omitempty"` }
ListFormOptions - modifies the behavior of FormService.List method
type ListFormSubscriberOptions ¶
type ListFormSubscriberOptions struct { FormID string `url:"-"` Filters *[]Filter `json:"filters,omitempty"` Page int `url:"page,omitempty"` Limit int `url:"limit,omitempty"` }
ListFormSubscriberOptions - modifies the behavior of FormService.Subscribers method
type ListGroupOptions ¶
type ListGroupOptions struct { Filters *[]Filter `json:"filters,omitempty"` Page int `url:"page,omitempty"` Limit int `url:"limit,omitempty"` Sort string `url:"sort,omitempty"` }
ListGroupOptions - modifies the behavior of GroupService.List method
type ListSegmentOptions ¶
type ListSegmentOptions struct { Page int `url:"page,omitempty"` Limit int `url:"limit,omitempty"` }
ListSegmentOptions - modifies the behavior of SegmentService.List method
type ListSegmentSubscriberOptions ¶
type ListSegmentSubscriberOptions struct { SegmentID string `url:"-"` Filters *[]Filter `json:"filters,omitempty"` Limit int `url:"limit,omitempty"` After int `url:"after,omitempty"` }
ListSegmentSubscriberOptions - modifies the behavior of SegmentService.Subscribers method
type ListSubscriberOptions ¶
type ListSubscriberOptions struct { Filters *[]Filter `json:"filters,omitempty"` Page int `url:"page,omitempty"` Limit int `url:"limit,omitempty"` }
ListSubscriberOptions - modifies the behavior of SubscriberService.List method
type ListWebhookOptions ¶
type ListWebhookOptions struct { Sort string `url:"sort,omitempty"` Page int `url:"page,omitempty"` Limit int `url:"limit,omitempty"` }
ListWebhookOptions - modifies the behavior of WebhookService.List method
type Meta ¶
type Meta struct { // offset based pagination CurrentPage int `json:"current_page"` From int `json:"from"` LastPage int `json:"last_page"` Links []MetaLinks `json:"links"` Path string `json:"path"` PerPage int `json:"per_page"` To int `json:"to"` *Aggregations `json:"aggregations,omitempty"` *Counts `json:"counts,omitempty"` // cursor based pagination Count int `json:"count"` Last int `json:"last"` Total int `json:"total"` TotalUnfiltered int `json:"total_unfiltered,omitempty"` }
type Rate ¶
type Rate struct { // The number of requests per minute the client is currently limited to. Limit int `json:"limit"` // The number of remaining requests the client can make this minute. Remaining int `json:"remaining"` // Retry After RetryAfter *time.Duration `json:"retry"` }
Rate represents the rate limit for the current client.
type RateLimitError ¶
type RateLimitError struct { Rate Rate // Rate specifies last known rate limit for the client Response *http.Response // HTTP response that caused this error Message string `json:"message"` // error message }
RateLimitError occurs when MailerLite returns 403 Forbidden response with a rate limit remaining value of 0.
func (*RateLimitError) Error ¶
func (r *RateLimitError) Error() string
type ResendSettings ¶
type Response ¶
type Response struct { *http.Response // Explicitly specify the Rate type so Rate's String() receiver doesn't // propagate to Response. Rate Rate }
Response is a MailerLite API response. This wraps the standard http.Response
type RootAutomation ¶ added in v1.0.6
type RootAutomation struct {
Data Automation `json:"data"`
}
type RootAutomations ¶ added in v1.0.6
type RootAutomations struct { Data []Automation `json:"data"` Links Links `json:"links"` Meta Meta `json:"meta"` }
type RootAutomationsSubscriber ¶ added in v1.0.6
type RootAutomationsSubscriber struct { Data []AutomationSubscriber `json:"data"` Links Links `json:"links"` Meta Meta `json:"meta"` }
type RootCampaign ¶ added in v1.0.6
type RootCampaign struct {
Data Campaign `json:"data"`
}
RootCampaign - single campaign response
type RootCampaignLanguages ¶ added in v1.0.6
type RootCampaignLanguages struct {
Data []CampaignLanguage
}
type RootCampaignSubscribers ¶ added in v1.0.6
type RootCampaignSubscribers struct { Data []CampaignSubscriber `json:"data"` Links Links `json:"links"` Meta Meta `json:"meta"` }
type RootCampaigns ¶ added in v1.0.6
type RootCampaigns struct { Data []Campaign `json:"data"` Links Links `json:"links"` Meta Meta `json:"meta"` }
RootCampaigns - campaigns response
type RootFields ¶ added in v1.0.6
type RootGroups ¶ added in v1.0.6
type RootSegment ¶ added in v1.0.6
type RootSegment struct {
Data Segment `json:"data"`
}
type RootSegments ¶ added in v1.0.6
type RootSubscriber ¶ added in v1.0.6
type RootSubscriber struct {
Data Subscriber `json:"data"`
}
subscribers - subscribers response
type RootSubscribers ¶ added in v1.0.6
type RootSubscribers struct { Data []Subscriber `json:"data"` Links Links `json:"links"` Meta Meta `json:"meta"` }
subscribers - subscribers response
type RootTimezones ¶ added in v1.0.6
type RootTimezones struct {
Data []Timezone `json:"data"`
}
type RootWebhook ¶ added in v1.0.6
type RootWebhook struct {
Data Webhook `json:"data"`
}
type RootWebhooks ¶ added in v1.0.6
type ScheduleCampaign ¶
type ScheduleCampaign struct { Delivery string `json:"delivery"` Schedule *Schedule `json:"schedule,omitempty"` Resend *Resend `json:"resend,omitempty"` }
ScheduleCampaign - modifies the behavior of campaignService.Schedule method
type SegmentService ¶
type SegmentService interface { List(ctx context.Context, options *ListSegmentOptions) (*RootSegments, *Response, error) Update(ctx context.Context, segmentID, segmentName string) (*RootSegment, *Response, error) Delete(ctx context.Context, segmentID string) (*Response, error) Subscribers(ctx context.Context, options *ListSegmentSubscriberOptions) (*RootSubscribers, *Response, error) }
SegmentService defines an interface for segment-related operations.
type SoftBounceRate ¶
type Stats ¶
type Stats struct { Sent int `json:"sent"` OpensCount int `json:"opens_count"` UniqueOpensCount int `json:"unique_opens_count"` OpenRate OpenRate `json:"open_rate"` ClicksCount int `json:"clicks_count"` UniqueClicksCount int `json:"unique_clicks_count"` ClickRate ClickRate `json:"click_rate"` UnsubscribesCount int `json:"unsubscribes_count"` UnsubscribeRate UnsubscribeRate `json:"unsubscribe_rate"` SpamCount int `json:"spam_count"` SpamRate SpamRate `json:"spam_rate"` HardBouncesCount int `json:"hard_bounces_count"` HardBounceRate HardBounceRate `json:"hard_bounce_rate"` SoftBouncesCount int `json:"soft_bounces_count"` SoftBounceRate SoftBounceRate `json:"soft_bounce_rate"` ForwardsCount int `json:"forwards_count"` ClickToOpenRate ClickToOpenRate `json:"click_to_open_rate"` }
type Step ¶
type Step struct { ID string `json:"id"` Type string `json:"type"` ParentID string `json:"parent_id"` Unit string `json:"unit,omitempty"` Complete bool `json:"complete,omitempty"` CreatedAt string `json:"created_at"` YesStepId string `json:"yes_step_id,omitempty"` NoStepId string `json:"no_step_id,omitempty"` Broken bool `json:"broken"` UpdatedAt string `json:"updated_at"` Value string `json:"value,omitempty"` MatchingType string `json:"matching_type,omitempty"` Description string `json:"description"` Name string `json:"name,omitempty"` Subject string `json:"subject,omitempty"` From string `json:"from,omitempty"` FromName string `json:"from_name,omitempty"` EmailID string `json:"email_id,omitempty"` Email *Email `json:"email,omitempty"` Conditions *[]Condition `json:"conditions,omitempty"` LanguageID int `json:"language_id,omitempty"` TrackOpens bool `json:"track_opens,omitempty"` GoogleAnalytics interface{} `json:"google_analytics,omitempty"` TrackingWasDisabled bool `json:"tracking_was_disabled,omitempty"` }
type Subscriber ¶
type Subscriber struct { ID string `json:"id,omitempty"` Email string `json:"email,omitempty"` Status string `json:"status,omitempty"` Source string `json:"source,omitempty"` Sent int `json:"sent,omitempty"` OpensCount int `json:"opens_count,omitempty"` ClicksCount int `json:"clicks_count,omitempty"` OpenRate float64 `json:"open_rate,omitempty"` ClickRate float64 `json:"click_rate,omitempty"` IPAddress interface{} `json:"ip_address,omitempty"` SubscribedAt string `json:"subscribed_at,omitempty"` UnsubscribedAt interface{} `json:"unsubscribed_at,omitempty"` CreatedAt string `json:"created_at,omitempty"` UpdatedAt string `json:"updated_at,omitempty"` Fields map[string]interface{} `json:"fields,omitempty"` Groups []Group `json:"groups,omitempty"` OptedInAt string `json:"opted_in_at,omitempty"` OptinIP string `json:"optin_ip,omitempty"` }
type SubscriberService ¶
type SubscriberService interface { List(ctx context.Context, options *ListSubscriberOptions) (*RootSubscribers, *Response, error) Count(ctx context.Context) (*Count, *Response, error) Get(ctx context.Context, options *GetSubscriberOptions) (*RootSubscriber, *Response, error) // Deprecated: use Upsert instead (https://github.com/mailerlite/mailerlite-go/issues/17) Create(ctx context.Context, subscriber *Subscriber) (*RootSubscriber, *Response, error) Upsert(ctx context.Context, subscriber *UpsertSubscriber) (*RootSubscriber, *Response, error) Update(ctx context.Context, subscriber *UpdateSubscriber) (*RootSubscriber, *Response, error) Delete(ctx context.Context, subscriberID string) (*Response, error) Forget(ctx context.Context, subscriberID string) (*RootSubscriber, *Response, error) }
SubscriberService defines an interface for subscriber-related operations.
type TimezoneService ¶
type TimezoneService interface {
List(ctx context.Context) (*RootTimezones, *Response, error)
}
TimezoneService defines an interface for timezone-related operations.
type TriggerData ¶
type Triggers ¶
type Triggers struct { ID string `json:"id"` Type string `json:"type"` GroupID string `json:"group_id"` Group AutomationGroupMeta `json:"group"` ExcludeGroupIds []interface{} `json:"exclude_group_ids"` ExcludedGroups []interface{} `json:"excluded_groups"` Broken bool `json:"broken"` }
type UnsubscribeRate ¶
type UpdateCampaign ¶
type UpdateCampaign CreateCampaign
type UpdateSubscriber ¶ added in v1.1.0
type UpdateSubscriber UpsertSubscriber
type UpdateWebhookOptions ¶
type UpdateWebhookOptions struct { WebhookID string `json:"-"` Name string `json:"name,omitempty"` Events []string `json:"events,omitempty"` Url string `json:"url,omitempty"` Enabled string `json:"enabled,omitempty"` }
UpdateWebhookOptions - modifies the behavior of WebhookService.Create method
type UpsertSubscriber ¶ added in v1.1.0
type UpsertSubscriber struct { ID string `json:"id,omitempty"` Email string `json:"email,omitempty"` Status string `json:"status,omitempty"` IPAddress interface{} `json:"ip_address,omitempty"` SubscribedAt string `json:"subscribed_at,omitempty"` UnsubscribedAt interface{} `json:"unsubscribed_at,omitempty"` Fields map[string]interface{} `json:"fields,omitempty"` Groups []string `json:"groups,omitempty"` OptedInAt string `json:"opted_in_at,omitempty"` OptinIP string `json:"optin_ip,omitempty"` }
type WebhookService ¶
type WebhookService interface { List(ctx context.Context, options *ListWebhookOptions) (*RootWebhooks, *Response, error) Get(ctx context.Context, webhookID string) (*RootWebhook, *Response, error) Create(ctx context.Context, webhook *CreateWebhookOptions) (*RootWebhook, *Response, error) Update(ctx context.Context, webhook *UpdateWebhookOptions) (*RootWebhook, *Response, error) Delete(ctx context.Context, webhookID string) (*Response, error) }
WebhookService defines an interface for webhook-related operations.