Help us shape the future of Go! Take the 2026 Go Developer Survey

sendpulse

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2019 License: MIT Imports: 10 Imported by: 0

README

SendPulse REST client library (unofficial)

An unofficial SendPulse REST client library for Go (Golang).

API Documentation https://sendpulse.com/api

Build Status codecov Go Report Card License

Download
go get -u github.com/dimuska139/sendpulse-sdk-go
Example
package main

import (
	"fmt"
	sendpulse "github.com/dimuska139/sendpulse-sdk-go"
)
const ApiUserId = "12345"
const ApiSecret = "12345"
const ApiTimeout = 5

func main() {
	addressBookId := 12345

	client, e := sendpulse.ApiClient(ApiUserId, ApiSecret, ApiTimeout)
	if e != nil {
		fmt.Println(e)
	}

	// Get address book info by id
	bookInfo, e := client.Books.Get(uint(addressBookId))
	if e != nil {
		fmt.Println(e)
	} else {
		fmt.Println(*bookInfo)
	}
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Book

type Book struct {
	ID               uint   `json:"id"`
	Name             string `json:"name"`
	AllEmailQty      uint   `json:"all_email_qty"`
	ActiveEmailQty   uint   `json:"active_email_qty"`
	InactiveEmailQty uint   `json:"inactive_email_qty"`
	CreationDate     string `json:"creationdate"`
	Status           uint   `json:"status"`
	StatusExplain    string `json:"status_explain"`
}

type CompaignCost added in v1.0.0

type CompaignCost struct {
	Cur                       string
	SentEmailsQty             int
	OverdraftAllEmailsPrice   int
	AddressesDeltaFromBalance int
	AddressesDeltaFromTariff  int
	MaxEmailsPerTask          int
	Result                    bool
}

type Contact added in v1.0.0

type Contact struct {
	Email         string
	Status        int
	StatusExplain string
	Variables     map[string]interface{}
}

type Email

type Email struct {
	Email     string                 `json:"email"`
	Variables map[string]interface{} `json:"variables"`
}

type Emails added in v1.0.0

type Emails struct {
	Books         books
	Automation360 automation360
}

type SendpulseClient

type SendpulseClient struct {
	Emails Emails
}

func ApiClient

func ApiClient(apiUserId string, apiSecret string, timeout int) (*SendpulseClient, error)

type SendpulseError

type SendpulseError struct {
	HttpCode int
	Url      string
	Body     string
	Message  string
}

func (*SendpulseError) Error

func (e *SendpulseError) Error() string

type Variable added in v1.0.0

type Variable struct {
	Name  string
	Type  string
	Value string
}

Jump to

Keyboard shortcuts

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