mailchimp

package
v0.2.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 25, 2018 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// APIURI is the host for Mailchimp API requests.
	APIURI = "https://us7.api.mailchimp.com"
)

Variables

View Source
var (
	// SubscribeURL is the url to send subscription requests to.
	SubscribeURL = APIURI + "/2.0/lists/subscribe"
)

Functions

func Subscribe

func Subscribe(apikey, listID, email string) error

Subscribe takes a mailchimp apikey, list id, and email address and subscribes it to a mailchimp newsletter.

Types

type Email

type Email struct {
	Email string `json:"email"`
}

Email defines a user's email.

type SubscribeRequest

type SubscribeRequest struct {
	APIKey      string `json:"apikey"`
	ID          string `json:"id"`
	Email       Email  `json:"email"`
	DoubleOptin bool   `json:"double_optin"`
	SendWelcome bool   `json:"send_welcome"`
}

SubscribeRequest defines the parameters sent to the mailchimp API to subscribe someone to a newsletter.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL