Documentation
¶
Index ¶
- Constants
- Variables
- func EmailToMemberID(email string) (string, error)
- type API
- func (api *API) CreateBatchOperation(ctx context.Context, body *BatchOperationCreationRequest) (*BatchOperationResponse, error)
- func (api *API) CreateCampaign(ctx context.Context, body *CampaignCreationRequest) (*CampaignResponse, error)
- func (api *API) CreateCampaignFolder(ctx context.Context, body *CampaignFolderCreationRequest) (*CampaignFolder, error)
- func (api *API) CreateList(ctx context.Context, body *ListCreationRequest) (*ListResponse, error)
- func (api *API) CreateTemplate(ctx context.Context, body *TemplateCreationRequest) (*TemplateResponse, error)
- func (api *API) CreateTemplateFolder(ctx context.Context, body *TemplateFolderCreationRequest) (*TemplateFolder, error)
- func (api *API) DeleteCampaign(ctx context.Context, id string) (bool, error)
- func (api *API) DeleteList(ctx context.Context, id string) (bool, error)
- func (api *API) DeleteTemplate(ctx context.Context, id string) (bool, error)
- func (api *API) GetBatchOperation(ctx context.Context, id string, params *BasicQueryParams) (*BatchOperationResponse, error)
- func (api *API) GetBatchOperations(ctx context.Context, params *ListQueryParams) (*ListOfBatchOperations, error)
- func (api *API) GetCampaign(ctx context.Context, id string, params *BasicQueryParams) (*CampaignResponse, error)
- func (api *API) GetCampaignContent(ctx context.Context, id string, params *BasicQueryParams) (*CampaignContentResponse, error)
- func (api *API) GetCampaignFolders(ctx context.Context, params *CampaignFolderQueryParams) (*ListOfCampaignFolders, error)
- func (api *API) GetCampaigns(ctx context.Context, params *CampaignQueryParams) (*ListOfCampaigns, error)
- func (api *API) GetList(ctx context.Context, id string, params *BasicQueryParams) (*ListResponse, error)
- func (api *API) GetLists(ctx context.Context, params *ListQueryParams) (*ListOfLists, error)
- func (api *API) GetRoot(ctx context.Context, params *BasicQueryParams) (*RootResponse, error)
- func (api *API) GetTemplate(ctx context.Context, id string, params *BasicQueryParams) (*TemplateResponse, error)
- func (api *API) GetTemplateDefaultContent(ctx context.Context, id string, params *BasicQueryParams) (*TemplateDefaultContentResponse, error)
- func (api *API) GetTemplateFolders(ctx context.Context, params *TemplateFolderQueryParams) (*ListOfTemplateFolders, error)
- func (api *API) GetTemplates(ctx context.Context, params *TemplateQueryParams) (*ListOfTemplates, error)
- func (api *API) ListAddOrUpdateMember(ctx context.Context, listID, memberID string, body *MemberRequest) (*Member, error)
- func (api *API) ListGetMembers(ctx context.Context, listID string, params *ListGetMembersParams) (*ListOfMembers, error)
- func (api *API) MemberForApiCalls(listId, email string) *Member
- func (api *API) NewListResponse(id string) *ListResponse
- func (api *API) ScheduleCampaign(ctx context.Context, id string, scheduleTime *time.Time) (bool, error)
- func (api *API) SendCampaign(ctx context.Context, id string, body *SendCampaignRequest) (bool, error)
- func (api *API) SendTestEmail(ctx context.Context, id string, body *TestEmailRequest) (bool, error)
- func (api *API) UnscheduleCampaign(ctx context.Context, id string) (bool, error)
- func (api *API) UpdateCampaign(ctx context.Context, id string, body *CampaignCreationRequest) (*CampaignResponse, error)
- func (api *API) UpdateCampaignContent(ctx context.Context, id string, body *CampaignContentUpdateRequest) (*CampaignContentResponse, error)
- func (api *API) UpdateList(ctx context.Context, id string, body *ListCreationRequest) (*ListResponse, error)
- func (api *API) UpdateTemplate(ctx context.Context, id string, body *TemplateCreationRequest) (*TemplateResponse, error)
- type APIError
- type AbuseReport
- type AccountContact
- type Activity
- type Address
- type BasicQueryParams
- type BatchOperation
- type BatchOperationCreationRequest
- type BatchOperationResponse
- type BatchSubscribeMembersError
- type BatchSubscribeMembersRequest
- type BatchSubscribeMembersResponse
- type CampaignContentResponse
- type CampaignContentTemplateRequest
- type CampaignContentUpdateRequest
- type CampaignCreationRecipients
- type CampaignCreationRequest
- type CampaignCreationSegmentOptions
- type CampaignCreationSettings
- type CampaignDefaults
- type CampaignDeliveryStatus
- type CampaignEcommerce
- type CampaignFolder
- type CampaignFolderCreationRequest
- type CampaignFolderQueryParams
- type CampaignQueryParams
- type CampaignReportSummary
- type CampaignResponse
- type CampaignResponseRecipients
- type CampaignResponseSettings
- type CampaignTracking
- type Client
- type Contact
- type Customer
- type ExtendedQueryParams
- type GrowthHistory
- type HookEvents
- type HookSources
- type IndustryStats
- type Interest
- type InterestCategoriesQueryParams
- type InterestCategory
- type InterestCategoryRequest
- type InterestRequest
- type InterestsCondition
- type LineItem
- type Link
- type ListCreationRequest
- type ListGetMembersParams
- type ListOfAbuseReports
- type ListOfActivity
- type ListOfBatchOperations
- type ListOfCampaignFolders
- type ListOfCampaigns
- type ListOfClients
- type ListOfGrownHistory
- type ListOfInterestCategories
- type ListOfInterests
- type ListOfLists
- type ListOfMemberActivity
- type ListOfMemberGoals
- type ListOfMemberNotes
- type ListOfMemberTags
- type ListOfMembers
- type ListOfMergeFields
- type ListOfSegments
- type ListOfTemplateFolders
- type ListOfTemplates
- type ListOfWebHooks
- type ListQueryParams
- type ListResponse
- func (list *ListResponse) AddOrUpdateMember(ctx context.Context, id string, body *MemberRequest) (*Member, error)
- func (list *ListResponse) BatchModifySegment(ctx context.Context, id string, body *SegmentBatchRequest) (*SegmentBatchResponse, error)
- func (list *ListResponse) BatchSubscribeMembers(ctx context.Context, body *BatchSubscribeMembersRequest) (*BatchSubscribeMembersResponse, error)
- func (list *ListResponse) CanMakeRequest() error
- func (list *ListResponse) CreateInterestCategory(ctx context.Context, body *InterestCategoryRequest) (*InterestCategory, error)
- func (list *ListResponse) CreateMember(ctx context.Context, body *MemberRequest) (*Member, error)
- func (list *ListResponse) CreateMergeField(ctx context.Context, body *MergeFieldRequest) (*MergeField, error)
- func (list *ListResponse) CreateSegment(ctx context.Context, body *SegmentRequest) (*Segment, error)
- func (list *ListResponse) CreateWebHooks(ctx context.Context, body *WebHookRequest) (*WebHook, error)
- func (list *ListResponse) DeleteInterestCategory(ctx context.Context, id string) (bool, error)
- func (list *ListResponse) DeleteMember(ctx context.Context, id string) (bool, error)
- func (list *ListResponse) DeleteMemberPermanent(ctx context.Context, id string) (bool, error)
- func (list *ListResponse) DeleteSegment(ctx context.Context, id string) (bool, error)
- func (list *ListResponse) DeleteWebHook(ctx context.Context, id string) (bool, error)
- func (list *ListResponse) GetAbuseReport(ctx context.Context, id string, params *ExtendedQueryParams) (*AbuseReport, error)
- func (list *ListResponse) GetAbuseReports(ctx context.Context, params *ExtendedQueryParams) (*ListOfAbuseReports, error)
- func (list *ListResponse) GetActivity(ctx context.Context, params *BasicQueryParams) (*ListOfActivity, error)
- func (list *ListResponse) GetClients(ctx context.Context, params *BasicQueryParams) (*ListOfClients, error)
- func (list *ListResponse) GetGrowthHistory(ctx context.Context, params *ExtendedQueryParams) (*ListOfGrownHistory, error)
- func (list *ListResponse) GetGrowthHistoryForMonth(ctx context.Context, month string, params *BasicQueryParams) (*GrowthHistory, error)
- func (list *ListResponse) GetInterest(ctx context.Context, interestCategoryID, interestID string, ...) (*Interest, error)
- func (list *ListResponse) GetInterestCategories(ctx context.Context, params *InterestCategoriesQueryParams) (*ListOfInterestCategories, error)
- func (list *ListResponse) GetInterestCategory(ctx context.Context, id string, params *BasicQueryParams) (*InterestCategory, error)
- func (list *ListResponse) GetInterests(ctx context.Context, interestCategoryID string, params *ExtendedQueryParams) (*ListOfInterests, error)
- func (list *ListResponse) GetMember(ctx context.Context, id string, params *BasicQueryParams) (*Member, error)
- func (list *ListResponse) GetMembers(ctx context.Context, params *ListGetMembersParams) (*ListOfMembers, error)
- func (list *ListResponse) GetMergeField(ctx context.Context, params *MergeFieldParams) (*MergeField, error)
- func (list *ListResponse) GetMergeFields(ctx context.Context, params *MergeFieldsParams) (*ListOfMergeFields, error)
- func (list *ListResponse) GetSegment(ctx context.Context, id string, params *BasicQueryParams) (*Segment, error)
- func (list *ListResponse) GetSegments(ctx context.Context, params *SegmentQueryParams) (*ListOfSegments, error)
- func (list *ListResponse) GetWebHook(ctx context.Context, id string) (*WebHook, error)
- func (list *ListResponse) GetWebHooks(ctx context.Context) (*ListOfWebHooks, error)
- func (list *ListResponse) SearchMembers(ctx context.Context, params *SearchMembersQueryParams) (*SearchMembersResponse, error)
- func (list *ListResponse) UpdateInterestCategory(ctx context.Context, id string, body *InterestCategoryRequest) (*InterestCategory, error)
- func (list *ListResponse) UpdateMember(ctx context.Context, id string, body *MemberRequest) (*Member, error)
- func (list *ListResponse) UpdateSegment(ctx context.Context, id string, body *SegmentRequest) (*Segment, error)
- func (list *ListResponse) UpdateWebHook(ctx context.Context, id string, body *WebHookRequest) (*WebHook, error)
- type Mailchimp
- type MarketingPermission
- type MarketingPermissions
- type Matches
- type Member
- func (mem *Member) CanMakeRequest() error
- func (mem *Member) CreateNote(ctx context.Context, msg string) (*MemberNoteLong, error)
- func (mem *Member) DeleteNote(ctx context.Context, id string) (bool, error)
- func (mem *Member) GetActivity(ctx context.Context, params *BasicQueryParams) (*ListOfMemberActivity, error)
- func (mem *Member) GetGoals(ctx context.Context, params *BasicQueryParams) (*ListOfMemberGoals, error)
- func (mem *Member) GetNote(ctx context.Context, id string, params *BasicQueryParams) (*MemberNoteLong, error)
- func (mem *Member) GetNotes(ctx context.Context, params *ExtendedQueryParams) (*ListOfMemberNotes, error)
- func (mem *Member) GetTags(ctx context.Context, params *ExtendedQueryParams) (*ListOfMemberTags, error)
- func (mem *Member) SetIdByMail(email string) *Member
- func (mem *Member) UpdateNote(ctx context.Context, id, msg string) (*MemberNoteLong, error)
- func (mem *Member) UpdateTags(ctx context.Context, tags []UpdateMemberTag) (*ListOfMemberTags, error)
- func (mem *Member) WithApi(api *API) *Member
- type MemberActivity
- type MemberGoal
- type MemberLocation
- type MemberNoteLong
- type MemberNoteShort
- type MemberRequest
- type MemberResponse
- type MemberStats
- type MemberTag
- type MemberTagLong
- type MergeField
- type MergeFieldOptions
- type MergeFieldParams
- type MergeFieldRequest
- type MergeFieldsParams
- type QueryParams
- type RootResponse
- type ScheduleCampaignRequest
- type SearchMembersQueryParams
- type SearchMembersResponse
- type Segment
- type SegmentBatchError
- type SegmentBatchRequest
- type SegmentBatchResponse
- type SegmentConditional
- type SegmentOptions
- type SegmentQueryParams
- type SegmentRequest
- type SendCampaignRequest
- type StaticSegmentCondition
- type Stats
- type TemplateCreationRequest
- type TemplateDefaultContentResponse
- type TemplateFolder
- type TemplateFolderCreationRequest
- type TemplateFolderQueryParams
- type TemplateQueryParams
- type TemplateResponse
- type TestEmailRequest
- type TimeToRun
- type UpdateMemberTag
- type WebHook
- type WebHookRequest
- type WorkflowType
- func WorkflowAPI(emailCount int, runtime TimeToRun) *WorkflowType
- func WorkflowBestCustomer(emailCount int, sendImmediately bool, lifetimePurchaseValue float64, ...) *WorkflowType
- func WorkflowCategoryFollowup(emailCount int, sendImmediately bool, categoryName string, runtime TimeToRun) *WorkflowType
- func WorkflowDateAdded(emailCount int, runtime TimeToRun) *WorkflowType
- func WorkflowEmailFollowup(emailCount int, triggerOnImport, sendImmediately bool, runtime TimeToRun) *WorkflowType
- func WorkflowEmailSeries(emailCount int, triggerOnImport, sendImmediately bool, runtime TimeToRun) *WorkflowType
- func WorkflowGroupAdd(emailCount int, sendImmediately bool, groupID int, runtime TimeToRun) *WorkflowType
- func WorkflowGroupRemove(emailCount int, sendImmediately bool, groupID int, runtime TimeToRun) *WorkflowType
- func WorkflowMandrill(emailCount int, sendImmediately bool, mandrillTags []string, runtime TimeToRun) *WorkflowType
- func WorkflowProductFollowup(emailCount int, sendImmediately bool, productName string, runtime TimeToRun) *WorkflowType
- func WorkflowPurchaseFollowup(emailCount int, sendImmediately bool, runtime TimeToRun) *WorkflowType
- func WorkflowRecurringEvent(emailCount int, mergeFieldTrigger string, runtime TimeToRun) *WorkflowType
- func WorkflowSpecialEvent(emailCount int, mergeFieldTrigger string, runtime TimeToRun) *WorkflowType
- func WorkflowVisitURL(emailCount int, sendImmediately bool, goalURL string, runtime TimeToRun) *WorkflowType
- func WorkflowWelcomeSeries(emailCount int, triggerOnImport, sendImmediately bool, runtime TimeToRun) *WorkflowType
Constants ¶
const ( CAMPAIGN_TYPE_REGULAR = "regular" CAMPAIGN_TYPE_PLAINTEXT = "plaintext" CAMPAIGN_TYPE_ABSPLIT = "absplit" // deprecated by mailchimp CAMPAIGN_TYPE_RSS = "rss" CAMPAIGN_TYPE_VARIATE = "variate" CAMPAIGN_SEND_TYPE_HTML = "html" CAMPAIGN_SEND_TYPE_PLAINTEXT = "plaintext" CONDITION_MATCH_ANY = "any" CONDITION_MATCH_ALL = "all" CONDITION_TYPE_INTERESTS = "Interests" CONDITION_OP_CONTAINS = "interestcontains" )
const URIFormat string = "%s.api.mailchimp.com"
URIFormat defines the endpoint for a single app
const Version string = "/3.0"
Version the latest API version
Variables ¶
var DatacenterRegex = regexp.MustCompile("[^-]\\w+$")
DatacenterRegex defines which datacenter to hit
Functions ¶
func EmailToMemberID ¶
EmailToMemberID converts given email address to subscriber_hash to be used as ID in Member API.
Types ¶
type API ¶
type API struct { Key string Client *http.Client User string Debug bool // contains filtered or unexported fields }
API represents the origin of the API
func (*API) CreateBatchOperation ¶
func (api *API) CreateBatchOperation(ctx context.Context, body *BatchOperationCreationRequest) (*BatchOperationResponse, error)
func (*API) CreateCampaign ¶
func (api *API) CreateCampaign(ctx context.Context, body *CampaignCreationRequest) (*CampaignResponse, error)
func (*API) CreateCampaignFolder ¶
func (api *API) CreateCampaignFolder(ctx context.Context, body *CampaignFolderCreationRequest) (*CampaignFolder, error)
func (*API) CreateList ¶
func (api *API) CreateList(ctx context.Context, body *ListCreationRequest) (*ListResponse, error)
func (*API) CreateTemplate ¶
func (api *API) CreateTemplate(ctx context.Context, body *TemplateCreationRequest) (*TemplateResponse, error)
func (*API) CreateTemplateFolder ¶
func (api *API) CreateTemplateFolder(ctx context.Context, body *TemplateFolderCreationRequest) (*TemplateFolder, error)
func (*API) DeleteCampaign ¶
func (*API) DeleteTemplate ¶
func (*API) GetBatchOperation ¶
func (api *API) GetBatchOperation(ctx context.Context, id string, params *BasicQueryParams) (*BatchOperationResponse, error)
func (*API) GetBatchOperations ¶
func (api *API) GetBatchOperations(ctx context.Context, params *ListQueryParams) (*ListOfBatchOperations, error)
func (*API) GetCampaign ¶
func (api *API) GetCampaign(ctx context.Context, id string, params *BasicQueryParams) (*CampaignResponse, error)
func (*API) GetCampaignContent ¶
func (api *API) GetCampaignContent(ctx context.Context, id string, params *BasicQueryParams) (*CampaignContentResponse, error)
func (*API) GetCampaignFolders ¶
func (api *API) GetCampaignFolders(ctx context.Context, params *CampaignFolderQueryParams) (*ListOfCampaignFolders, error)
func (*API) GetCampaigns ¶
func (api *API) GetCampaigns(ctx context.Context, params *CampaignQueryParams) (*ListOfCampaigns, error)
func (*API) GetList ¶
func (api *API) GetList(ctx context.Context, id string, params *BasicQueryParams) (*ListResponse, error)
func (*API) GetLists ¶
func (api *API) GetLists(ctx context.Context, params *ListQueryParams) (*ListOfLists, error)
func (*API) GetRoot ¶
func (api *API) GetRoot(ctx context.Context, params *BasicQueryParams) (*RootResponse, error)
GetRoot queries the root of the API for stats
func (*API) GetTemplate ¶
func (api *API) GetTemplate(ctx context.Context, id string, params *BasicQueryParams) (*TemplateResponse, error)
func (*API) GetTemplateDefaultContent ¶
func (api *API) GetTemplateDefaultContent(ctx context.Context, id string, params *BasicQueryParams) (*TemplateDefaultContentResponse, error)
func (*API) GetTemplateFolders ¶
func (api *API) GetTemplateFolders(ctx context.Context, params *TemplateFolderQueryParams) (*ListOfTemplateFolders, error)
func (*API) GetTemplates ¶
func (api *API) GetTemplates(ctx context.Context, params *TemplateQueryParams) (*ListOfTemplates, error)
func (*API) ListAddOrUpdateMember ¶
func (*API) ListGetMembers ¶
func (api *API) ListGetMembers(ctx context.Context, listID string, params *ListGetMembersParams) (*ListOfMembers, error)
func (*API) MemberForApiCalls ¶
The Member struct returned by this should be all you need to start calling APIs for this member, meaning it should pass CanMakeRequest.
func (*API) NewListResponse ¶
func (api *API) NewListResponse(id string) *ListResponse
NewListResponse returns a *ListResponse that is minimally viable for making API requests. This is useful for such API requests that depend on a ListResponse for its ID (e.g. CreateMember) without having to make a second network request to get the list itself.
func (*API) ScheduleCampaign ¶
func (api *API) ScheduleCampaign(ctx context.Context, id string, scheduleTime *time.Time) (bool, error)
ScheduleCampaign UTC date and time to schedule the campaign for delivery in ISO 8601 format. Campaigns may only be scheduled to send on the quarter-hour (:00, :15, :30, :45).
func (*API) SendCampaign ¶
func (*API) SendTestEmail ¶
func (*API) UnscheduleCampaign ¶
func (*API) UpdateCampaign ¶
func (api *API) UpdateCampaign(ctx context.Context, id string, body *CampaignCreationRequest) (*CampaignResponse, error)
func (*API) UpdateCampaignContent ¶
func (api *API) UpdateCampaignContent(ctx context.Context, id string, body *CampaignContentUpdateRequest) (*CampaignContentResponse, error)
func (*API) UpdateList ¶
func (api *API) UpdateList(ctx context.Context, id string, body *ListCreationRequest) (*ListResponse, error)
func (*API) UpdateTemplate ¶
func (api *API) UpdateTemplate(ctx context.Context, id string, body *TemplateCreationRequest) (*TemplateResponse, error)
type APIError ¶
type APIError struct { Type string `json:"type,omitempty"` Title string `json:"title,omitempty"` Status int `json:"status,omitempty"` Detail string `json:"detail,omitempty"` Instance string `json:"instance,omitempty"` ReferenceNumber string `json:"ref_no,omitempty"` Errors []struct { Field string `json:"field"` Message string `json:"message"` } `json:"errors,omitempty"` }
APIError is what the what the api returns on error
type AbuseReport ¶
type AccountContact ¶
type Activity ¶
type Activity struct { Day string `json:"day"` EmailsSent int `json:"emails_sent"` UniqueOpens int `json:"unique_opens"` RecipientClicks int `json:"recipient_clicks"` HardBounce int `json:"hard_bounce"` SoftBounce int `json:"soft_bounce"` Subs int `json:"subs"` Unsubs int `json:"unsubs"` OtherAdds int `json:"other_adds"` OtherRemoves int `json:"other_removes"` // contains filtered or unexported fields }
type Address ¶
type Address struct { Address1 string `json:"address1"` Address2 string `json:"address2"` City string `json:"city"` Province string `json:"province"` ProvinceCode string `json:"province_code"` PostalCode string `json:"postal_code"` Country string `json:"country"` CountryCode string `json:"country_code"` Longitude float64 `json:"longitude"` Latitude float64 `json:"latitude"` }
Address represents what it says
type BasicQueryParams ¶
type BasicQueryParams struct { Status string SortField string SortDirection string Fields []string ExcludeFields []string }
BasicQueryParams basic filter queries
func (*BasicQueryParams) Params ¶
func (q *BasicQueryParams) Params() map[string]string
type BatchOperation ¶
type BatchOperationCreationRequest ¶
type BatchOperationCreationRequest struct {
Operations []BatchOperation `json:"operations"`
}
type BatchOperationResponse ¶
type BatchOperationResponse struct { Links []Link `json:"_links,omitempty"` ID string `json:"id"` Status string `json:"status"` TotalOperations int `json:"total_operations"` FinishedOperations int `json:"finished_operations"` ErroredOperations int `json:"errored_operations"` SubmittedAt string `json:"submitted_at,omitempty"` CompletedAt string `json:"completed_at,omitempty"` ResponseBodyUrl string `json:"response_body_url"` // contains filtered or unexported fields }
type BatchSubscribeMembersError ¶
type BatchSubscribeMembersError struct { EmailAddress string `json:"email_address"` ErrorMessage string `json:"error"` ErrorCode string `json:"error_code"` }
------------------------------------------------------------------------------------------------ Batch subscribe list members ------------------------------------------------------------------------------------------------
type BatchSubscribeMembersRequest ¶
type BatchSubscribeMembersRequest struct { Members []MemberRequest `json:"members"` UpdateExisting bool `json:"update_existing"` }
type BatchSubscribeMembersResponse ¶
type BatchSubscribeMembersResponse struct { NewMembers []Member `json:"new_members"` UpdatedMembers []Member `json:"updated_members"` ErrorMessages []BatchSubscribeMembersError `json:"errors"` TotalCreated int `json:"total_created"` TotalUpdated int `json:"total_updated"` ErrorCount int `json:"error_count"` // contains filtered or unexported fields }
type CampaignContentResponse ¶
type CampaignContentUpdateRequest ¶
type CampaignContentUpdateRequest struct { PlainText string `json:"plain_text"` Html string `json:"html"` Url string `json:"url"` Template *CampaignContentTemplateRequest `json:"template,omitempty"` }
type CampaignCreationRecipients ¶
type CampaignCreationRecipients struct { ListId string `json:"list_id"` SegmentOptions CampaignCreationSegmentOptions `json:"segment_opts"` }
type CampaignCreationRequest ¶
type CampaignCreationRequest struct { Type string `json:"type"` // must be one of the CAMPAIGN_TYPE_* consts Recipients CampaignCreationRecipients `json:"recipients"` Settings CampaignCreationSettings `json:"settings"` // variate_settings not implemented Tracking CampaignTracking `json:"tracking"` }
type CampaignCreationSegmentOptions ¶
type CampaignCreationSegmentOptions struct { SavedSegmentId int `json:"saved_segment_id,omitempty"` Match string `json:"match,omitempty"` // one of CONDITION_MATCH_* // this accepts various payloads. See http://developer.mailchimp.com/documentation/mailchimp/reference/campaigns/#create-post_campaigns Conditions interface{} `json:"conditions,omitempty"` }
type CampaignCreationSettings ¶
type CampaignCreationSettings struct { SubjectLine string `json:"subject_line"` PreviewText string `json:"preview_text"` Title string `json:"title"` FromName string `json:"from_name"` ReplyTo string `json:"reply_to"` UseConversation bool `json:"use_conversation"` ToName string `json:"to_name"` FolderId string `json:"folder_id"` Authenticate bool `json:"authenticate"` InlineCss bool `json:"inline_css"` AutoTweet bool `json:"auto_tweet"` FbComments bool `json:"fb_comments"` TemplateId uint `json:"template_id"` }
type CampaignDefaults ¶
type CampaignDeliveryStatus ¶
type CampaignEcommerce ¶
type CampaignFolder ¶
type CampaignFolderCreationRequest ¶
type CampaignFolderCreationRequest struct {
Name string `json:"name"`
}
type CampaignFolderQueryParams ¶
type CampaignFolderQueryParams struct {
ExtendedQueryParams
}
type CampaignQueryParams ¶
type CampaignQueryParams struct { ExtendedQueryParams Type string Status string BeforeSendTime string SinceSendTime string BeforeCreateTime string SinceCreateTime string ListId string FolderId string SortField string SortDir string }
func (CampaignQueryParams) Params ¶
func (q CampaignQueryParams) Params() map[string]string
type CampaignReportSummary ¶
type CampaignReportSummary struct { Opens int64 `json:"opens"` UniqueOpens int64 `json:"unique_opens"` OpenRate float64 `json:"open_rate"` Clicks int64 `json:"clicks"` SubscriberClicks int64 `json:"subscriber_clicks"` ClickRate float64 `json:"click_rate"` Ecommerce CampaignEcommerce `json:"ecommerce"` }
type CampaignResponse ¶
type CampaignResponse struct { ID string `json:"id"` WebID int64 `json:"web_id"` Type string `json:"type"` CreateTime string `json:"create_time"` ArchiveUrl string `json:"archive_url"` LongArchiveUrl string `json:"long_archive_url"` Status string `json:"status"` EmailsSent int64 `json:"emails_sent"` SendTime string `json:"send_time"` ContentType string `json:"content_type"` NeedsBlockRefresh bool `json:"needs_block_refresh"` Recipients CampaignResponseRecipients `json:"recipients"` Settings CampaignResponseSettings `json:"settings"` Tracking CampaignTracking `json:"tracking"` ReportSummary CampaignReportSummary `json:"report_summary"` DeliveryStatus CampaignDeliveryStatus `json:"delivery_status"` // contains filtered or unexported fields }
func (CampaignResponse) CanMakeRequest ¶
func (campaign CampaignResponse) CanMakeRequest() error
type CampaignResponseSettings ¶
type CampaignResponseSettings struct { SubjectLine string `json:"subject_line"` PreviewText string `json:"preview_text"` Title string `json:"title"` FromName string `json:"from_name"` ReplyTo string `json:"reply_to"` UseConversation bool `json:"use_conversation"` ToName string `json:"to_name"` FolderId string `json:"folder_id"` Authenticate bool `json:"authenticate"` InlineCss bool `json:"inline_css"` AutoTweet bool `json:"auto_tweet"` FbComments bool `json:"fb_comments"` Timewarp bool `json:"timewarp"` TemplateId uint `json:"template_id"` DragAndDrop bool `json:"drag_and_drop"` }
type CampaignTracking ¶
type Contact ¶
type Contact struct { Company string `json:"company"` Address1 string `json:"address1"` Address2 string `json:"address2"` City string `json:"city"` State string `json:"state"` Zip string `json:"zip"` Country string `json:"country"` PhoneNumber string `json:"phone"` }
Contact defines a single contact
type Customer ¶
type Customer struct { // Required ID string `json:"id"` // Optional EmailAddress string `json:"email_address,omitempty"` OptInStatus bool `json:"opt_in_status,omitempty"` Company string `json:"company,omitempty"` FirstName string `json:"first_name,omitempty"` LastName string `json:"last_name,omitempty"` OrdersCount int `json:"orders_count,omitempty"` TotalSpent float64 `json:"total_spent,omitempty"` Address *Address `json:"address,omitempty"` // Response CreatedAt string `json:"created_at,omitempty"` UpdatedAt string `json:"updated_at,omitempty"` Links []Link `json:"_links,omitempty"` }
Customer defines a mailchimp customer
type ExtendedQueryParams ¶
type ExtendedQueryParams struct { BasicQueryParams Count int Offset int }
ExtendedQueryParams includes a count and offset
func (*ExtendedQueryParams) Params ¶
func (q *ExtendedQueryParams) Params() map[string]string
type GrowthHistory ¶
type HookEvents ¶
type HookSources ¶
type IndustryStats ¶
type InterestCategoriesQueryParams ¶
type InterestCategoriesQueryParams struct { ExtendedQueryParams Type string `json:"type"` }
func (*InterestCategoriesQueryParams) Params ¶
func (q *InterestCategoriesQueryParams) Params() map[string]string
type InterestCategory ¶
type InterestCategory struct { InterestCategoryRequest ListID string `json:"list_id"` ID string `json:"id"` // contains filtered or unexported fields }
func (*InterestCategory) CanMakeRequest ¶
func (interestCatgory *InterestCategory) CanMakeRequest() error
func (*InterestCategory) CreateInterest ¶
func (interestCategory *InterestCategory) CreateInterest(ctx context.Context, body *InterestRequest) (*Interest, error)
type InterestCategoryRequest ¶
type InterestRequest ¶
type InterestsCondition ¶
type LineItem ¶
type LineItem struct { // Required ID string `json:"id"` ProductID string `json:"product_id"` ProductVariantID string `json:"product_variant_id"` Quantity int `json:"quantity"` Price float64 `json:"price"` // Optional ProductTitle string `json:"product_title,omitempty"` ProductVariantTitle string `json:"product_variant_title,omitempty"` }
LineItem defines a mailchimp cart or order line item
type Link ¶
type Link struct { Rel string `json:"re"` Href string `json:"href"` Method string `json:"method"` TargetSchema string `json:"targetSchema"` Schema string `json:"schema"` }
Link refereneces another object
type ListCreationRequest ¶
type ListCreationRequest struct { Name string `json:"name"` Contact Contact `json:"contact"` PermissionReminder string `json:"permission_reminder"` UseArchiveBar bool `json:"use_archive_bar"` CampaignDefaults CampaignDefaults `json:"campaign_defaults"` NotifyOnSubscribe string `json:"notify_on_subscribe"` NotifyOnUnsubscribe string `json:"notify_on_unsubscribe"` EmailTypeOption bool `json:"email_type_option"` Visibility string `json:"visibility"` }
type ListGetMembersParams ¶
type ListGetMembersParams struct { ExtendedQueryParams UnsubscribedSince string `json:"unsubscribed_since"` SinceTimestampOpt string `json:"since_timestamp_opt"` BeforeTimestampOpt string `json:"before_timestamp_opt"` SinceLastChanged string `json:"since_last_changed"` BeforeLastChanged string `json:"before_last_changed"` SinceLastCampaign string `json:"since_last_campaign"` UniqueEmailID string `json:"unique_email_id"` }
type ListOfAbuseReports ¶
type ListOfAbuseReports struct { ListID string `json:"list_id"` Reports []AbuseReport `json:"abuse_reports"` // contains filtered or unexported fields }
type ListOfActivity ¶
type ListOfBatchOperations ¶
type ListOfBatchOperations struct { BatchOperations []BatchOperationResponse `json:"batches"` // contains filtered or unexported fields }
type ListOfCampaignFolders ¶
type ListOfCampaignFolders struct { Folders []CampaignFolder `json:"folders"` // contains filtered or unexported fields }
type ListOfCampaigns ¶
type ListOfCampaigns struct { Campaigns []*CampaignResponse `json:"campaigns"` // contains filtered or unexported fields }
type ListOfClients ¶
type ListOfGrownHistory ¶
type ListOfGrownHistory struct { ListID string `json:"list_id"` History []GrowthHistory `json:"history"` // contains filtered or unexported fields }
type ListOfInterestCategories ¶
type ListOfInterestCategories struct { ListID string `json:"list_id"` Categories []InterestCategory `json:"categories"` // contains filtered or unexported fields }
type ListOfInterests ¶
type ListOfLists ¶
type ListOfLists struct { Lists []ListResponse `json:"lists"` // contains filtered or unexported fields }
type ListOfMemberActivity ¶
type ListOfMemberGoals ¶
type ListOfMemberGoals struct { EmailID string `json:"email_id"` ListID string `json:"list_id"` Goals []MemberGoal `json:"goals"` // contains filtered or unexported fields }
type ListOfMemberNotes ¶
type ListOfMemberNotes struct { EmailID string `json:"email_id"` ListID string `json:"list_id"` Notes []MemberNoteLong `json:"notes"` // contains filtered or unexported fields }
type ListOfMemberTags ¶
type ListOfMemberTags struct { Tags []MemberTagLong `json:"tags"` // contains filtered or unexported fields }
type ListOfMembers ¶
type ListOfMergeFields ¶
type ListOfMergeFields struct { ListID string `json:"list_id"` MergeFields []MergeField `json:"merge_fields"` // contains filtered or unexported fields }
type ListOfSegments ¶
type ListOfTemplateFolders ¶
type ListOfTemplateFolders struct { Folders []TemplateFolder `json:"folders"` // contains filtered or unexported fields }
type ListOfTemplates ¶
type ListOfTemplates struct { Templates []TemplateResponse `json:"templates"` // contains filtered or unexported fields }
type ListOfWebHooks ¶
type ListQueryParams ¶
type ListQueryParams struct { ExtendedQueryParams BeforeDateCreated string SinceDateCreated string BeforeCampaignLastSent string SinceCampaignLastSent string Email string }
func (ListQueryParams) Params ¶
func (q ListQueryParams) Params() map[string]string
type ListResponse ¶
type ListResponse struct { ListCreationRequest ID string `json:"id"` WebID int64 `json:"web_id"` DateCreated string `json:"date_created"` ListRating int `json:"list_rating"` SubscribeURLShort string `json:"subscribe_url_short"` SubscribeURLLong string `json:"subscribe_url_long"` BeamerAddress string `json:"beamer_address"` Modules []string `json:"modules"` Stats Stats `json:"stats"` // contains filtered or unexported fields }
func (*ListResponse) AddOrUpdateMember ¶
func (list *ListResponse) AddOrUpdateMember(ctx context.Context, id string, body *MemberRequest) (*Member, error)
func (*ListResponse) BatchModifySegment ¶
func (list *ListResponse) BatchModifySegment(ctx context.Context, id string, body *SegmentBatchRequest) (*SegmentBatchResponse, error)
BatchModifySegment adds and/or removes one or more emails from a static segment using POST /lists/{list_id}/segments/{segment_id}. NOTE: You MUST check SegmentBatchResponse for errors, as there may be multiple errors (i.e. multiple failures to add/remove), and err may still be nil.
func (*ListResponse) BatchSubscribeMembers ¶
func (list *ListResponse) BatchSubscribeMembers(ctx context.Context, body *BatchSubscribeMembersRequest) (*BatchSubscribeMembersResponse, error)
func (*ListResponse) CanMakeRequest ¶
func (list *ListResponse) CanMakeRequest() error
func (*ListResponse) CreateInterestCategory ¶
func (list *ListResponse) CreateInterestCategory(ctx context.Context, body *InterestCategoryRequest) (*InterestCategory, error)
func (*ListResponse) CreateMember ¶
func (list *ListResponse) CreateMember(ctx context.Context, body *MemberRequest) (*Member, error)
func (*ListResponse) CreateMergeField ¶
func (list *ListResponse) CreateMergeField(ctx context.Context, body *MergeFieldRequest) (*MergeField, error)
func (*ListResponse) CreateSegment ¶
func (list *ListResponse) CreateSegment(ctx context.Context, body *SegmentRequest) (*Segment, error)
func (*ListResponse) CreateWebHooks ¶
func (list *ListResponse) CreateWebHooks(ctx context.Context, body *WebHookRequest) (*WebHook, error)
func (*ListResponse) DeleteInterestCategory ¶
func (*ListResponse) DeleteMember ¶
func (*ListResponse) DeleteMemberPermanent ¶
func (*ListResponse) DeleteSegment ¶
func (*ListResponse) DeleteWebHook ¶
func (*ListResponse) GetAbuseReport ¶
func (list *ListResponse) GetAbuseReport(ctx context.Context, id string, params *ExtendedQueryParams) (*AbuseReport, error)
func (*ListResponse) GetAbuseReports ¶
func (list *ListResponse) GetAbuseReports(ctx context.Context, params *ExtendedQueryParams) (*ListOfAbuseReports, error)
func (*ListResponse) GetActivity ¶
func (list *ListResponse) GetActivity(ctx context.Context, params *BasicQueryParams) (*ListOfActivity, error)
func (*ListResponse) GetClients ¶
func (list *ListResponse) GetClients(ctx context.Context, params *BasicQueryParams) (*ListOfClients, error)
func (*ListResponse) GetGrowthHistory ¶
func (list *ListResponse) GetGrowthHistory(ctx context.Context, params *ExtendedQueryParams) (*ListOfGrownHistory, error)
func (*ListResponse) GetGrowthHistoryForMonth ¶
func (list *ListResponse) GetGrowthHistoryForMonth(ctx context.Context, month string, params *BasicQueryParams) (*GrowthHistory, error)
func (*ListResponse) GetInterest ¶
func (list *ListResponse) GetInterest(ctx context.Context, interestCategoryID, interestID string, params *BasicQueryParams) (*Interest, error)
func (*ListResponse) GetInterestCategories ¶
func (list *ListResponse) GetInterestCategories(ctx context.Context, params *InterestCategoriesQueryParams) (*ListOfInterestCategories, error)
func (*ListResponse) GetInterestCategory ¶
func (list *ListResponse) GetInterestCategory(ctx context.Context, id string, params *BasicQueryParams) (*InterestCategory, error)
func (*ListResponse) GetInterests ¶
func (list *ListResponse) GetInterests(ctx context.Context, interestCategoryID string, params *ExtendedQueryParams) (*ListOfInterests, error)
func (*ListResponse) GetMember ¶
func (list *ListResponse) GetMember(ctx context.Context, id string, params *BasicQueryParams) (*Member, error)
func (*ListResponse) GetMembers ¶
func (list *ListResponse) GetMembers(ctx context.Context, params *ListGetMembersParams) (*ListOfMembers, error)
func (*ListResponse) GetMergeField ¶
func (list *ListResponse) GetMergeField(ctx context.Context, params *MergeFieldParams) (*MergeField, error)
func (*ListResponse) GetMergeFields ¶
func (list *ListResponse) GetMergeFields(ctx context.Context, params *MergeFieldsParams) (*ListOfMergeFields, error)
func (*ListResponse) GetSegment ¶
func (list *ListResponse) GetSegment(ctx context.Context, id string, params *BasicQueryParams) (*Segment, error)
func (*ListResponse) GetSegments ¶
func (list *ListResponse) GetSegments(ctx context.Context, params *SegmentQueryParams) (*ListOfSegments, error)
func (*ListResponse) GetWebHook ¶
func (*ListResponse) GetWebHooks ¶
func (list *ListResponse) GetWebHooks(ctx context.Context) (*ListOfWebHooks, error)
func (*ListResponse) SearchMembers ¶
func (list *ListResponse) SearchMembers(ctx context.Context, params *SearchMembersQueryParams) (*SearchMembersResponse, error)
func (*ListResponse) UpdateInterestCategory ¶
func (list *ListResponse) UpdateInterestCategory(ctx context.Context, id string, body *InterestCategoryRequest) (*InterestCategory, error)
func (*ListResponse) UpdateMember ¶
func (list *ListResponse) UpdateMember(ctx context.Context, id string, body *MemberRequest) (*Member, error)
func (*ListResponse) UpdateSegment ¶
func (list *ListResponse) UpdateSegment(ctx context.Context, id string, body *SegmentRequest) (*Segment, error)
func (*ListResponse) UpdateWebHook ¶
func (list *ListResponse) UpdateWebHook(ctx context.Context, id string, body *WebHookRequest) (*WebHook, error)
type Mailchimp ¶
type Mailchimp interface { CreateBatchOperation(ctx context.Context, body *BatchOperationCreationRequest) (*BatchOperationResponse, error) CreateCampaign(ctx context.Context, body *CampaignCreationRequest) (*CampaignResponse, error) CreateCampaignFolder(ctx context.Context, body *CampaignFolderCreationRequest) (*CampaignFolder, error) CreateList(ctx context.Context, body *ListCreationRequest) (*ListResponse, error) CreateTemplate(ctx context.Context, body *TemplateCreationRequest) (*TemplateResponse, error) CreateTemplateFolder(ctx context.Context, body *TemplateFolderCreationRequest) (*TemplateFolder, error) DeleteCampaign(ctx context.Context, id string) (bool, error) DeleteList(ctx context.Context, id string) (bool, error) DeleteTemplate(ctx context.Context, id string) (bool, error) GetBatchOperation(ctx context.Context, id string, params *BasicQueryParams) (*BatchOperationResponse, error) GetBatchOperations(ctx context.Context, params *ListQueryParams) (*ListOfBatchOperations, error) GetCampaign(ctx context.Context, id string, params *BasicQueryParams) (*CampaignResponse, error) GetCampaignContent(ctx context.Context, id string, params *BasicQueryParams) (*CampaignContentResponse, error) GetCampaignFolders(ctx context.Context, params *CampaignFolderQueryParams) (*ListOfCampaignFolders, error) GetCampaigns(ctx context.Context, params *CampaignQueryParams) (*ListOfCampaigns, error) GetList(ctx context.Context, id string, params *BasicQueryParams) (*ListResponse, error) GetLists(ctx context.Context, params *ListQueryParams) (*ListOfLists, error) GetRoot(ctx context.Context, params *BasicQueryParams) (*RootResponse, error) GetTemplate(ctx context.Context, id string, params *BasicQueryParams) (*TemplateResponse, error) GetTemplateDefaultContent(ctx context.Context, id string, params *BasicQueryParams) (*TemplateDefaultContentResponse, error) GetTemplateFolders(ctx context.Context, params *TemplateFolderQueryParams) (*ListOfTemplateFolders, error) GetTemplates(ctx context.Context, params *TemplateQueryParams) (*ListOfTemplates, error) MemberForApiCalls(listId string, email string) *Member NewListResponse(id string) *ListResponse SendCampaign(ctx context.Context, id string, body *SendCampaignRequest) (bool, error) // ScheduleCampaign UTC date and time to schedule the campaign for delivery in ISO 8601 format. Campaigns may only be scheduled to send on the quarter-hour (:00, :15, :30, :45). ScheduleCampaign(ctx context.Context, id string, scheduleTime *time.Time) (bool, error) UnscheduleCampaign(ctx context.Context, id string) (bool, error) SendTestEmail(ctx context.Context, id string, body *TestEmailRequest) (bool, error) UpdateCampaign(ctx context.Context, id string, body *CampaignCreationRequest) (*CampaignResponse, error) UpdateCampaignContent(ctx context.Context, id string, body *CampaignContentUpdateRequest) (*CampaignContentResponse, error) UpdateList(ctx context.Context, id string, body *ListCreationRequest) (*ListResponse, error) UpdateTemplate(ctx context.Context, id string, body *TemplateCreationRequest) (*TemplateResponse, error) // ListAddOrUpdateMember if memberID is empty, body.EmailAddress is hashed as ID ListAddOrUpdateMember(ctx context.Context, listID, memberID string, body *MemberRequest) (*Member, error) ListGetMembers(ctx context.Context, listID string, params *ListGetMembersParams) (*ListOfMembers, error) }
type MarketingPermission ¶
type MarketingPermissions ¶
type MarketingPermissions []MarketingPermission
type Member ¶
type Member struct { MemberResponse ID string `json:"id"` ListID string `json:"list_id"` UniqueEmailID string `json:"unique_email_id"` EmailType string `json:"email_type"` Stats MemberStats `json:"stats"` MemberRating int `json:"member_rating"` LastChanged string `json:"last_changed"` EmailClient string `json:"email_client"` LastNote MemberNoteShort `json:"last_note"` // contains filtered or unexported fields }
func (*Member) CanMakeRequest ¶
func (*Member) CreateNote ¶
func (*Member) DeleteNote ¶
func (*Member) GetActivity ¶
func (mem *Member) GetActivity(ctx context.Context, params *BasicQueryParams) (*ListOfMemberActivity, error)
func (*Member) GetGoals ¶
func (mem *Member) GetGoals(ctx context.Context, params *BasicQueryParams) (*ListOfMemberGoals, error)
func (*Member) GetNote ¶
func (mem *Member) GetNote(ctx context.Context, id string, params *BasicQueryParams) (*MemberNoteLong, error)
func (*Member) GetNotes ¶
func (mem *Member) GetNotes(ctx context.Context, params *ExtendedQueryParams) (*ListOfMemberNotes, error)
func (*Member) GetTags ¶
func (mem *Member) GetTags(ctx context.Context, params *ExtendedQueryParams) (*ListOfMemberTags, error)
func (*Member) SetIdByMail ¶
func (*Member) UpdateNote ¶
func (*Member) UpdateTags ¶
func (mem *Member) UpdateTags(ctx context.Context, tags []UpdateMemberTag) (*ListOfMemberTags, error)
type MemberActivity ¶
type MemberGoal ¶
type MemberLocation ¶
type MemberNoteLong ¶
type MemberNoteShort ¶
type MemberRequest ¶
type MemberRequest struct { EmailAddress string `json:"email_address"` EmailType string `json:"email_type,omitempty"` Status string `json:"status"` StatusIfNew string `json:"status_if_new,omitempty"` MergeFields map[string]interface{} `json:"merge_fields,omitempty"` Interests map[string]bool `json:"interests,omitempty"` Language string `json:"language"` VIP bool `json:"vip"` Location *MemberLocation `json:"location,omitempty"` MarketingPermissions *MarketingPermissions `json:"marketing_permissions,omitempty"` IPOpt string `json:"ip_opt,omitempty"` IPSignup string `json:"ip_signup,omitempty"` Tags []string `json:"tags,omitempty"` TimestampSignup string `json:"timestamp_signup,omitempty"` TimestampOpt string `json:"timestamp_opt,omitempty"` }
type MemberResponse ¶
type MemberResponse struct { EmailAddress string `json:"email_address"` EmailType string `json:"email_type,omitempty"` Status string `json:"status"` StatusIfNew string `json:"status_if_new,omitempty"` MergeFields map[string]interface{} `json:"merge_fields,omitempty"` Interests map[string]bool `json:"interests,omitempty"` Language string `json:"language"` VIP bool `json:"vip"` Location *MemberLocation `json:"location,omitempty"` IPOpt string `json:"ip_opt,omitempty"` IPSignup string `json:"ip_signup,omitempty"` Tags []MemberTag `json:"tags,omitempty"` TimestampSignup string `json:"timestamp_signup,omitempty"` TimestampOpt string `json:"timestamp_opt,omitempty"` }
type MemberStats ¶
type MemberTagLong ¶
type MergeField ¶
type MergeField struct { MergeID int `json:"merge_id"` Tag string `json:"tag"` Name string `json:"name"` Type string `json:"type"` Required bool `json:"required"` DefaultValue string `json:"default_value"` Public bool `json:"public"` DisplayOrder int `json:"display_order"` Options MergeFieldOptions `json:"options"` HelpText string `json:"help_text"` ListID string `json:"list_id"` // contains filtered or unexported fields }
type MergeFieldOptions ¶
type MergeFieldParams ¶
type MergeFieldParams struct { BasicQueryParams MergeID string `json:"_"` }
type MergeFieldRequest ¶
type MergeFieldRequest struct { // The tag used in MailChimp campaigns and for the /members endpoint. Tag string `json:"tag"` // The name of the merge field. Name string `json:"name"` // The type for the merge field. // Possible Values: text, number, address, phone, date, url, image, url, radio, dropdown, birthday, zip Type string `json:"type"` // The boolean value if the merge field is required. Required bool `json:"required"` // The default value for the merge field if null. DefaultValue string `json:"default_value"` // Whether the merge field is displayed on the signup form. Public bool `json:"public"` // The order that the merge field displays on the list signup form. DisplayOrder int `json:"display_order"` // The order that the merge field displays on the list signup form. Options MergeFieldOptions `json:"options"` // Extra text to help the subscriber fill out the form. HelpText string `json:"help_text"` }
type MergeFieldsParams ¶
type MergeFieldsParams struct { ExtendedQueryParams Type string `json:"type"` Required bool `json:"required"` }
type QueryParams ¶
QueryParams defines the different params
type RootResponse ¶
type RootResponse struct { AccountID string `json:"account_id"` AccountName string `json:"account_name"` Email string `json:"email"` Role string `json:"role"` Contact AccountContact `json:"contact"` ProEnabled bool `json:"pro_enabled"` LastLogin string `json:"last_login"` TotalSubscribers int `json:"total_subscribers"` IndustyStats IndustryStats `json:"industry_stats"` Links []Link `json:"_links"` }
RootResponse - https://developer.mailchimp.com/documentation/mailchimp/reference/root/#read-get_root
type ScheduleCampaignRequest ¶
type ScheduleCampaignRequest struct { // The UTC date and time to schedule the campaign for delivery in ISO 8601 format. Campaigns may only be scheduled to send on the quarter-hour (:00, :15, :30, :45). ScheduleTime string `json:"schedule_time"` }
type SearchMembersQueryParams ¶
type SearchMembersQueryParams struct { BasicQueryParams Query string // contains filtered or unexported fields }
func (*SearchMembersQueryParams) Params ¶
func (q *SearchMembersQueryParams) Params() map[string]string
type SearchMembersResponse ¶
type SegmentBatchError ¶
type SegmentBatchError struct { EmailAddresses []string `json:"email_addresses"` Error string `json:"error"` }
SegmentBatchError contains errors returned from batch modifying a static segment
type SegmentBatchRequest ¶
type SegmentBatchRequest struct { MembersToAdd []string `json:"members_to_add"` MembersToRemove []string `json:"members_to_remove"` }
SegmentBatchRequest represents arguments for bach modifying a static segment. Note that both options must be provided, even if empty slice, and cannot be nil, or mailchimp will return a 400.
type SegmentBatchResponse ¶
type SegmentBatchResponse struct { MembersAdded []Member `json:"members_added"` MembersRemoved []Member `json:"members_removed"` Errors []SegmentBatchError `json:"errors"` TotalAdded int `json:"total_added"` TotalRemoved int `json:"total_removed"` ErrorCount int `json:"error_count"` // contains filtered or unexported fields }
SegmentBatchResponse is the object returned by MailChimp from a request to batch modify a static segment
type SegmentConditional ¶
type SegmentConditional struct { Field string `json:"field"` OP string `json:"op"` Value interface{} `json:"value"` }
SegmentConditional represents parameters to filter by
type SegmentOptions ¶
type SegmentOptions struct { Match string `json:"match"` Conditions []SegmentConditional `json:"conditions"` }
type SegmentQueryParams ¶
type SegmentQueryParams struct { ExtendedQueryParams Type string SinceCreatedAt string BeforeCreatedAt string SinceUpdatedAt string BeforeUpdatedAt string }
func (*SegmentQueryParams) Params ¶
func (q *SegmentQueryParams) Params() map[string]string
type SegmentRequest ¶
type SegmentRequest struct { Name string `json:"name"` StaticSegment []string `json:"static_segment"` Options *SegmentOptions `json:"options,omitempty"` }
type SendCampaignRequest ¶
type SendCampaignRequest struct {
CampaignId string `json:"campaign_id"`
}
type StaticSegmentCondition ¶
type StaticSegmentCondition struct { ConditionType string `json:"condition_type"` Field string `json:"field"` Op string `json:"op"` Value int `json:"value"` }
func NewStaticSegmentCondition ¶
func NewStaticSegmentCondition(id int, isEqual bool) *StaticSegmentCondition
type Stats ¶
type Stats struct { MemberCount int `json:"member_count"` UnsubscribeCount int `json:"unsubscribe_count"` CleanedCount int `json:"cleaned_count"` MemberCountSinceSend int `json:"member_count_since_send"` UnsubscribeCountSinceSend int `json:"unsubscribe_count_since_send"` CleanedCountSinceSend int `json:"cleaned_count_since_send"` CampaignCount int `json:"campaign_count"` CampaignLastSent string `json:"campaign_last_sent"` MergeFieldCount int `json:"merge_field_count"` AvgSubRate float64 `json:"avg_sub_rate"` AvgUnsubRate float64 `json:"avg_unsub_rate"` TargetSubRate float64 `json:"target_sub_rate"` OpenRate float64 `json:"open_rate"` ClickRate float64 `json:"click_rate"` LastSubDate string `json:"last_sub_date"` LastUnsubDate string `json:"last_unsub_date"` }
type TemplateCreationRequest ¶
type TemplateFolder ¶
type TemplateFolderCreationRequest ¶
type TemplateFolderCreationRequest struct {
Name string `json:"name"`
}
type TemplateFolderQueryParams ¶
type TemplateFolderQueryParams struct {
ExtendedQueryParams
}
type TemplateQueryParams ¶
type TemplateQueryParams struct { ExtendedQueryParams CreatedBy string SinceCreatedAt string BeforeCreatedAt string Type string FolderId string }
func (*TemplateQueryParams) Params ¶
func (q *TemplateQueryParams) Params() map[string]string
type TemplateResponse ¶
type TemplateResponse struct { ID uint `json:"id"` Type string `json:"type"` Name string `json:"name"` DragAndDrop bool `json:"drag_and_drop"` Responsive bool `json:"responsive"` Category string `json:"category"` DateCreated string `json:"date_created"` CreatedBy string `json:"created_by"` Active bool `json:"activer"` FolderId string `json:"folder_id"` Thumbnail string `json:"thumbnail"` // contains filtered or unexported fields }
func (*TemplateResponse) CanMakeRequest ¶
func (template *TemplateResponse) CanMakeRequest() error
type TestEmailRequest ¶
type UpdateMemberTag ¶
type WebHook ¶
type WebHook struct { WebHookRequest ID string `json:"id"` ListID string `json:"list_id"` // contains filtered or unexported fields }
type WebHookRequest ¶
type WebHookRequest struct { URL string `json:"url"` Events HookEvents `json:"events"` Sources HookSources `json:"sources"` }
type WorkflowType ¶
type WorkflowType map[string]interface{}
func WorkflowAPI ¶
func WorkflowAPI(emailCount int, runtime TimeToRun) *WorkflowType
func WorkflowBestCustomer ¶
func WorkflowCategoryFollowup ¶
func WorkflowCategoryFollowup(emailCount int, sendImmediately bool, categoryName string, runtime TimeToRun) *WorkflowType
func WorkflowDateAdded ¶
func WorkflowDateAdded(emailCount int, runtime TimeToRun) *WorkflowType
func WorkflowEmailFollowup ¶
func WorkflowEmailFollowup(emailCount int, triggerOnImport, sendImmediately bool, runtime TimeToRun) *WorkflowType
func WorkflowEmailSeries ¶
func WorkflowEmailSeries(emailCount int, triggerOnImport, sendImmediately bool, runtime TimeToRun) *WorkflowType
func WorkflowGroupAdd ¶
func WorkflowGroupAdd(emailCount int, sendImmediately bool, groupID int, runtime TimeToRun) *WorkflowType
func WorkflowGroupRemove ¶
func WorkflowGroupRemove(emailCount int, sendImmediately bool, groupID int, runtime TimeToRun) *WorkflowType
func WorkflowMandrill ¶
func WorkflowMandrill(emailCount int, sendImmediately bool, mandrillTags []string, runtime TimeToRun) *WorkflowType
func WorkflowProductFollowup ¶
func WorkflowProductFollowup(emailCount int, sendImmediately bool, productName string, runtime TimeToRun) *WorkflowType
func WorkflowPurchaseFollowup ¶
func WorkflowPurchaseFollowup(emailCount int, sendImmediately bool, runtime TimeToRun) *WorkflowType
func WorkflowRecurringEvent ¶
func WorkflowRecurringEvent(emailCount int, mergeFieldTrigger string, runtime TimeToRun) *WorkflowType
func WorkflowSpecialEvent ¶
func WorkflowSpecialEvent(emailCount int, mergeFieldTrigger string, runtime TimeToRun) *WorkflowType
func WorkflowVisitURL ¶
func WorkflowVisitURL(emailCount int, sendImmediately bool, goalURL string, runtime TimeToRun) *WorkflowType
func WorkflowWelcomeSeries ¶
func WorkflowWelcomeSeries(emailCount int, triggerOnImport, sendImmediately bool, runtime TimeToRun) *WorkflowType