Documentation
¶
Index ¶
- Constants
- func EmailToHash(email string) string
- type Category
- type CategoryType
- type Client
- func (c *Client) AddInterest(listId, categoryId, interest *Interest) (*Interest, error)
- func (c *Client) AddMember(listId string, member *Member) (*Member, error)
- func (c *Client) Call(method string, endpoint string, data interface{}, results interface{}) error
- func (c *Client) CreateInterestCategory(listId string, category *Category) (*Category, error)
- func (c *Client) CreateList(list *List) (List, error)
- func (c *Client) DeleteInterest(listId, categoryId, id string) error
- func (c *Client) DeleteInterestCategory(listId, categoryId string) error
- func (c *Client) DeleteList(listId string) error
- func (c *Client) DeleteMember(listId, emailHash string) error
- func (c *Client) Details() (Detail, error)
- func (c *Client) Interest(listId, categoryId, id string) (Interest, error)
- func (c *Client) InterestCategories(listId string) ([]Category, error)
- func (c *Client) InterestCategory(listId, categoryId string) (Category, error)
- func (c *Client) Interests(listId, categoryId string) ([]Interest, error)
- func (c *Client) List(listId string) (List, error)
- func (c *Client) Lists() ([]List, error)
- func (c *Client) Member(listId, emailHash string) (*Member, error)
- func (c *Client) Members(listId string) ([]*Member, error)
- func (c *Client) UpdateInterest(listId, categoryId, interest *Interest) (*Interest, error)
- func (c *Client) UpdateInterestCategory(listId, categoryId string, category *Category) (*Category, error)
- func (c *Client) UpdateList(list *List) (List, error)
- func (c *Client) UpdateMember(listId string, member *Member) (*Member, error)
- func (c *Client) UpsertMember(listId string, member *Member) (*Member, error)
- type Contact
- type Detail
- type EmailType
- type Interest
- type List
- type Member
- type Message
- type SubscriptionStatus
- type VisibilityStatus
Constants ¶
View Source
const ( Checkboxes CategoryType = "checkboxes" Dropdown = "dropdown" Radio = "radio" Hidden = "hidden" )
View Source
const ( Subscribed SubscriptionStatus = "subscribed" Unsubscribed = "unsubscribed" SubscriptionCleaned = "cleaned" SubscriptionPending = "pending" )
View Source
const ENDPOINT string = "https://%s.api.mailchimp.com/3.0/%s"
Variables ¶
This section is empty.
Functions ¶
func EmailToHash ¶
Types ¶
type Category ¶
type Category struct {
Id string `json:"id"`
ListId string `json:"list_id"`
Title string `json:"title"`
DisplayOrder uint `json:"display_order"`
Type CategoryType `json:"type"`
}
type CategoryType ¶
type CategoryType string
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) AddInterest ¶
func (*Client) CreateInterestCategory ¶
func (*Client) DeleteInterest ¶
func (*Client) DeleteInterestCategory ¶
func (*Client) DeleteList ¶
func (*Client) DeleteMember ¶
func (*Client) InterestCategories ¶
func (*Client) InterestCategory ¶
func (*Client) UpdateInterest ¶
func (*Client) UpdateInterestCategory ¶
func (*Client) UpdateMember ¶
type List ¶
type List struct {
Id string `json:"id,omitempty"`
Name string `json:"name"`
Contact Contact `json:"contact"`
PermissionReminder string `json:"permission_reminder"`
UseArchiveBar bool `json:"use_archive_bar,omitempty"`
CampaignDefaults struct {
FromName string `json:"from_name"`
FromEmail string `json:"from_email"`
Subject string `json:"subject"`
Language string `json:"language"`
} `json:"campaign_defaults"`
NotifyOnSubscribe string `json:"notify_on_subscribe,omitempty"`
NotifyOnUnsubscribe string `json:"notify_on_unsubscribe,omitempty"`
DateCreated string `json:"date_created,omitempty"`
ListRating uint `json:"list_rating,omitempty"`
EmailTypeOption bool `json:"email_type_option"`
SubscribeUrlShort string `json:"subscribe_url_short,omitempty"`
SubscribeUrlLong string `json:"subscribe_url_long,omitempty"`
BeamerAddress string `json:"beamer_address,omitempty"`
Visibility VisibilityStatus `json:"visibility,omitempty"`
Modules []string `json:"modules,omitempty"`
Stats struct {
MemberCount uint64 `json:"member_count"`
UnsubscribeCount uint64 `json:"unsubscribe_count"`
CleanedCount uint64 `json:"cleaned_count"`
MemberCountSinceSend uint64 `json:"member_count_since_send"`
UnsubscribeCountSinceSend uint64 `json:"unsubscribe_count_since_send"`
CleanedCountSinceSend uint64 `json:"cleaned_count_since_send"`
CampaignCount uint64 `json:"campaign_count"`
CampaignLastSent string `json:"campaign_last_sent,omitempty"`
MergeFieldCount int `json:"merge_field_count"`
AvgSubRate float32 `json:"avg_sub_rate"`
AvgUnsubRate float32 `json:"avg_unsub_rate"`
TargetSubRate float32 `json:"target_sub_rate"`
OpenRate float32 `json:"open_rate"`
ClickRate float32 `json:"click_rate"`
LastSubDate string `json:"last_sub_date,omitempty"`
LastUnsubDate string `json:"last_unsub_date,omitempty"`
} `json:"stats,omitempty"`
}
type Member ¶
type Member struct {
Id string `json:"id,omitempty"`
EmailAddress string `json:"email_address"`
UniqueEmailId string `json:"unique_email_id,omitempty"`
EmailType EmailType `json:"email_type,omitempty"`
Status SubscriptionStatus `json:"status,omitempty"`
StatusIfNew SubscriptionStatus `json:"status_if_new,omitempty"`
MergeFields map[string]interface{} `json:"merge_fields,omitempty"`
Interests map[string]bool `json:"interests,omitempty"`
Stats struct {
AvgOpenRate float32 `json:"avg_open_rate,omitempty"`
AvgClickRate float32 `json:"avg_click_rate,omitempty"`
} `json:"stats,omitempty"`
IpSignup string `json:"ip_signup,omitempty"`
TimestampSignup string `json:"timestamp_signup,omitempty"`
IpOpt string `json:"ip_opt,omitempty"`
TimestampOpt string `json:"timestamp_opt,omitempty"`
MemberRating uint `json:"member_rating,omitempty"`
LastChanged string `json:"last_changed,omitempty"`
Language string `json:"language,omitempty"`
Vip bool `json:"vip,omitempty"`
EmailClient string `json:"email_client,omitempty"`
Location struct {
Lat float64 `json:"latitude,omitempty"`
Lon float64 `json:"longitude,omitempty"`
Gmtoff int `json:"gmtoff,omitempty"`
Dstoff int `json:"dstoff,omitempty"`
CountryCode string `json:"country_code,omitempty"`
Timezone string `json:"timezone,omitempty"`
} `json:"location,omitempty"`
LastNote struct {
Id string `json:"note_id,omitempty"`
CreatedAt string `json:"created_at,omitempty"`
CreatedBy string `json:"created_by,omitempty"`
Note string `json:"note,omitempty"`
} `json:"last_note,omitempty"`
ListId string `json:"list_id,omitempty"`
}
func (*Member) SetMergeField ¶
type Message ¶
type Message struct {
FromName string `json:"from_name"`
FromEmail string `json:"from_email"`
Subject string `json:"subject"`
Language string `json:"language"`
}
FIXME merge with Mandrill Message
type SubscriptionStatus ¶
type SubscriptionStatus string
type VisibilityStatus ¶
type VisibilityStatus string
const ( PublicVisibility VisibilityStatus = "pub" PrivateVisibility = "prv" )
Click to show internal directories.
Click to hide internal directories.