aweber

package module
v0.0.0-...-21c0dd5 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2020 License: BSD-3-Clause Imports: 10 Imported by: 0

README

go-aweber

A golang package to interact with the Aweber API

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Aweber

type Aweber struct {
	Client *http.Client
	// contains filtered or unexported fields
}

Aweber contains the necessary data to interact with the Aweber API.

func NewAweber

func NewAweber(accountID string) (*Aweber, error)

NewAweber creates and returns a new Aweber struct used for calls to the Aweber API

func (*Aweber) AddSubscriber

func (a *Aweber) AddSubscriber(listName string, sub *SubscriberData) error

AddSubscriber sends an authorized POST request to add an the SubscriberData as a new subscriber.

func (*Aweber) GetListID

func (a *Aweber) GetListID(listName string) (int, error)

GetListID returns the list ID of the requested list by name

func (*Aweber) GetLists

func (a *Aweber) GetLists() *Lists

GetLists returns the list data from the Aweber lists API

type CustomFields

type CustomFields interface{}

type List

type List struct {
	CampaignsCollectionLink             string `json:"campaigns_collection_link"`
	CustomFieldsCollectionLink          string `json:"custom_fields_collection_link"`
	DraftBroadcastsLink                 string `json:"draft_broadcasts_link"`
	ScheduledBroadcastsLink             string `json:"scheduled_broadcasts_link"`
	SentBroadcastsLink                  string `json:"sent_broadcasts_link"`
	HTTPEtag                            string `json:"http_etag"`
	ID                                  int    `json:"id"`
	LandingPagesCollectionLink          string `json:"landing_pages_collection_link"`
	Name                                string `json:"name"`
	ResourceTypeLink                    string `json:"resource_type_link"`
	SegmentsCollectionLink              string `json:"segments_collection_link"`
	SelfLink                            string `json:"self_link"`
	SubscribersCollectionLink           string `json:"subscribers_collection_link"`
	TotalSubscribedSubscribers          int    `json:"total_subscribed_subscribers"`
	TotalSubscribers                    int    `json:"total_subscribers"`
	TotalSubscribersSubscribedToday     int    `json:"total_subscribers_subscribed_today"`
	TotalSubscribersSubscribedYesterday int    `json:"total_subscribers_subscribed_yesterday"`
	TotalUnconfirmedSubscribers         int    `json:"total_unconfirmed_subscribers"`
	TotalUnsubscribedSubscribers        int    `json:"total_unsubscribed_subscribers"`
	UniqueListID                        string `json:"unique_list_id"`
	UUID                                string `json:"uuid"`
	WebFormSplitTestsCollectionLink     string `json:"web_form_split_tests_collection_link"`
	WebFormsCollectionLink              string `json:"web_forms_collection_link"`
}

type Lists

type Lists struct {
	Entries []struct {
		CampaignsCollectionLink             string `json:"campaigns_collection_link"`
		CustomFieldsCollectionLink          string `json:"custom_fields_collection_link"`
		DraftBroadcastsLink                 string `json:"draft_broadcasts_link"`
		ScheduledBroadcastsLink             string `json:"scheduled_broadcasts_link"`
		SentBroadcastsLink                  string `json:"sent_broadcasts_link"`
		HTTPEtag                            string `json:"http_etag"`
		ID                                  int    `json:"id"`
		LandingPagesCollectionLink          string `json:"landing_pages_collection_link"`
		Name                                string `json:"name"`
		ResourceTypeLink                    string `json:"resource_type_link"`
		SegmentsCollectionLink              string `json:"segments_collection_link"`
		SelfLink                            string `json:"self_link"`
		SubscribersCollectionLink           string `json:"subscribers_collection_link"`
		TotalSubscribedSubscribers          int    `json:"total_subscribed_subscribers"`
		TotalSubscribers                    int    `json:"total_subscribers"`
		TotalSubscribersSubscribedToday     int    `json:"total_subscribers_subscribed_today"`
		TotalSubscribersSubscribedYesterday int    `json:"total_subscribers_subscribed_yesterday"`
		TotalUnconfirmedSubscribers         int    `json:"total_unconfirmed_subscribers"`
		TotalUnsubscribedSubscribers        int    `json:"total_unsubscribed_subscribers"`
		UniqueListID                        string `json:"unique_list_id"`
		UUID                                string `json:"uuid"`
		WebFormSplitTestsCollectionLink     string `json:"web_form_split_tests_collection_link"`
		WebFormsCollectionLink              string `json:"web_forms_collection_link"`
	} `json:"entries"`
	NextCollectionLink string `json:"next_collection_link"`
	PrevCollectionLink string `json:"prev_collection_link"`
	ResourceTypeLink   string `json:"resource_type_link"`
	Start              int    `json:"start"`
	TotalSize          int    `json:"total_size"`
}

type SubscriberData

type SubscriberData struct {
	AdTracking                    string       `json:"ad_tracking"`
	CustomFields                  CustomFields `json:"custom_fields"`
	Email                         string       `json:"email"`
	IPAddress                     string       `json:"ip_address"`
	LastFollowupMessageNumberSent int          `json:"last_followup_message_number_sent"`
	MiscNotes                     string       `json:"misc_notes"`
	Name                          string       `json:"name"`
	StrictCustomFields            string       `json:"strict_custom_fields"`
	Tags                          []string     `json:"tags"`
}

func NewSubscriberData

func NewSubscriberData(email, name string, tags []string) *SubscriberData

NewSubscriberData returns a NewSubscriberData struct without assigned data it is up to the user to assign the valuse they want included in the POST request. Only "Email" is required.

Jump to

Keyboard shortcuts

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