Documentation
¶
Index ¶
- type Client
- func (c *Client) CheckSubscription(listID string, email string) (*MemberResponse, error)
- func (c *Client) GetBaseURL() *url.URL
- func (c *Client) RemoveSubscription(listID string, email string, mergeFields map[string]interface{}) (*MemberResponse, error)
- func (c *Client) SetBaseURL(baseURL *url.URL)
- func (c *Client) Subscribe(listID string, email string, mergeFields map[string]interface{}) (*MemberResponse, error)
- func (c *Client) UpdateSubscription(listID string, email string, mergeFields map[string]interface{}) (*MemberResponse, error)
- type ClientInterface
- type ClientMock
- func (_m *ClientMock) CheckSubscription(listID string, email string) (*MemberResponse, error)
- func (_m *ClientMock) GetBaseURL() *url.URL
- func (_m *ClientMock) SetBaseURL(baseURL *url.URL)
- func (_m *ClientMock) Subscribe(listID string, email string, mergeFields map[string]interface{}) (*MemberResponse, error)
- func (_m *ClientMock) UpdateSubscription(listID string, email string, mergeFields map[string]interface{}) (*MemberResponse, error)
- type ErrorResponse
- type MemberResponse
- type SubError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client manages communication with the Mailchimp API.
func (*Client) CheckSubscription ¶
func (c *Client) CheckSubscription(listID string, email string) (*MemberResponse, error)
CheckSubscription ...
func (*Client) RemoveSubscription ¶
func (c *Client) RemoveSubscription(listID string, email string, mergeFields map[string]interface{}) (*MemberResponse, error)
UpdateSubscription ...
func (*Client) Subscribe ¶
func (c *Client) Subscribe(listID string, email string, mergeFields map[string]interface{}) (*MemberResponse, error)
Subscribe ...
func (*Client) UpdateSubscription ¶
func (c *Client) UpdateSubscription(listID string, email string, mergeFields map[string]interface{}) (*MemberResponse, error)
UpdateSubscription ...
type ClientInterface ¶
type ClientInterface interface {
// Exported methods
CheckSubscription(listID string, email string) (*MemberResponse, error)
Subscribe(listID string, email string, mergeFields map[string]interface{}) (*MemberResponse, error)
UpdateSubscription(listID string, email string, mergeFields map[string]interface{}) (*MemberResponse, error)
RemoveSubscription(listID string, email string, mergeFields map[string]interface{}) (*MemberResponse, error)
SetBaseURL(baseURL *url.URL)
GetBaseURL() *url.URL
}
ClientInterface defines exported methods
type ClientMock ¶
ClientMock is a mocked object implementing MailchimpInterface
func (*ClientMock) CheckSubscription ¶
func (_m *ClientMock) CheckSubscription(listID string, email string) (*MemberResponse, error)
CheckSubscription ...
func (*ClientMock) Subscribe ¶
func (_m *ClientMock) Subscribe(listID string, email string, mergeFields map[string]interface{}) (*MemberResponse, error)
Subscribe ...
func (*ClientMock) UpdateSubscription ¶
func (_m *ClientMock) UpdateSubscription(listID string, email string, mergeFields map[string]interface{}) (*MemberResponse, error)
UpdateSubscription ...
type ErrorResponse ¶
type ErrorResponse struct {
Type string `json:"type"`
Title string `json:"title"`
Status int `json:"status"`
Detail string `json:"detail"`
Errors []SubError `json:"errors"`
}
ErrorResponse ...
type MemberResponse ¶
type MemberResponse struct {
ID string `json:"id"` // The MD5 hash of the list member's email address.
EmailAddress string `json:"email_address"`
UniqueEmailID string `json:"unique_email_id"` // An identifier for the address across all of MailChimp.
EmailType string `json:"email_type"` // Type of email this member asked to get ('html' or 'text').
Status string `json:"status"`
VIP bool `json:"vip"`
IPSignup string `json:"ip_signup"` // IP address the subscriber signed up from.
TimestampSignup string `json:"timestamp_signup"` // Date and time the subscriber signed up for the list.
IPOpt string `json:"ip_opt"` // IP address the subscriber confirmed their opt-in status.
TimestampOpt string `json:"timestamp_opt"` // Date and time the subscribe confirmed their opt-in status.
MemberRating uint `json:"member_rating"` // Star rating for this member between 1 and 5.
LastChanged string `json:"last_changed"` // Date and time the member's info was last changed.
ListID string `json:"list_id"` // The id for the list.
MergeFields map[string]interface{} `json:"merge_fields"` // merge fields
}
MemberResponse - see https://api.mailchimp.com/schema/3.0/Lists/Members/Instance.json?_ga=1.216961300.323879299.1464708316
Source Files
¶
Click to show internal directories.
Click to hide internal directories.