Documentation ¶
Overview ¶
Package mailchimp provides a complete API to work with the MailChimp HTTP API.
Specifications leveraged:
- Analytics
Index ¶
- Constants
- type Config
- type Handler
- func (h *Handler) Close() error
- func (h *Handler) Config() integration.Config
- func (h *Handler) ConfigMap() map[string]any
- func (h *Handler) Init() error
- func (h *Handler) IsReady() bool
- func (h *Handler) ListActivities() []string
- func (h *Handler) ListWorkflows() []string
- func (h *Handler) RegisterWithAnalytics(w worker.Worker, config analytics.Config) error
- func (h *Handler) String() string
- type RegulationMode
Constants ¶
const Integration string = "mailchimp"
Integration is the string representation of the MailChimp integration.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { // Integration represents the common config shared across all integrations. Integration integration.Config `json:"integration"` // APIKey is the Mailchimp API Key to use for loading data into Mailchimp. You // can create and copy-paste your Mailchimp API Key from the MailChimp dashboard, // located at: // "Account Settings" > "Extras" > "API Keys". // // Required. APIKey string `json:"-"` // DatacenterID is the datacenter identifier of your Mailchimp account. You // can find it in the Mailchimp URL in your browser when you are logged in. It // is the "us1" in "https://us1.admin.mailchimp.com/lists/". // // Required. DatacenterID string `json:"datacenter_id"` // AudienceID is the audience identifier to connect to. You can find your // Audience ID in your Mailchimp Settings pane under the Audiences tab from // the MailChimp dashboard, located at: // "Manage Audiences" > "Settings" > "Audience Name & Defaults". // // Required. AudienceID string `json:"audience_id"` // EnableDoubleOptIn is an optional flag to control whether a double opt-in // confirmation message is sent when subscribing new users. When enabled, the // status of a new subscriber will be set to "pending" until the subscription // has been confirmed by the subscriber (via email). When disabled, the // subscription will automatically be set to "subscribed" and no email // confirmation is sent to the subscriber. // // Defaults to false. EnableDoubleOptIn bool `json:"double_optin"` // RegulationType is the MailChimp's type of regulation to use for user // suppression and deletion. // // Defaults to RegulationArchive. RegulationType RegulationMode `json:"regulation_type"` // contains filtered or unexported fields }
Config is the configuration an end-user should set to configure the MailChimp integration.
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
Handler handles the MailChimp integration and gives access to related workflows and activities.
func New ¶
New returns a new mailchimp Handler. It applies the configuration passed by the end-user.
func (*Handler) Close ¶
Close closes the integration and the specifications registered by the end-user. An error is returned in case the Handler has already been closed.
func (*Handler) Config ¶ added in v0.12.0
func (h *Handler) Config() integration.Config
Config returns the common integration's Config, which is the Config shared by all integrations.
func (*Handler) ConfigMap ¶
ConfigMap transforms the configuration to a map, including a "specifications" key with the configuration for each specification configured.
func (*Handler) Init ¶
Init initializes the integration and specifications the end-user wants to use. An error is returned in case the Handler has already been initialized.
func (*Handler) IsReady ¶
IsReady returns if the integration is ready to be consumed by the end-user. The integration must be initialized and must not be closed. This also ensures the specifications leveraged are ready to be consumed. If one of them is not, the integration would not be ready.
func (*Handler) ListActivities ¶
ListActivities returns a sorted list of activities' name registered by the integration (and the specifications leveraged if applicable).
func (*Handler) ListWorkflows ¶
ListWorkflows returns a sorted list of workflows' name registered by the integration (and the specifications leveraged if applicable).
func (*Handler) RegisterWithAnalytics ¶
RegisterWithAnalytics registers the analytics specification within the MailChimp integration. End-users will have access to workflows and activities exposed by the analytics specification.
type RegulationMode ¶
type RegulationMode string
RegulationMode is a custom string type to be aware of the different regulation types that exist in the MailChimp API.
const RegulationArchive RegulationMode = "Archive"
RegulationArchive is used to archive a user from a list. The user will not be deleted and could be re-imported if desired.
const RegulationDelete RegulationMode = "Delete"
RegulationDelete is used to delete all personally identifiable information related to a user, and remove them from a list. This will make it impossible to re-import the user in the list.