Skip to content

zhashkevych/sendpulse-sdk-go

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

79 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SendPulse REST client library (unofficial)

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

API Documentation https://sendpulse.com/api

Installation

go get -u github.com/zhashkevych/sendpulse-sdk-go

Usage

package main

import (
	"fmt"
	"github.com/zhashkevych/sendpulse-sdk-go/sendpulse"
	"net/http"
)

func main() {
	config := &sendpulse.Config{
		UserID: "",
		Secret: "",
	}
	client := sendpulse.NewClient(http.DefaultClient, config)
	
	emails := make([]*sendpulse.EmailToAdd, 0)
	emails = append(emails, &sendpulse.EmailToAdd{
		Email:     "test@test.com",
		Variables: map[string]interface{}{"age": 21, "weight": 99},
	})

	if err := client.Emails.MailingLists.SingleOptIn(1266208, emails); err != nil {
		fmt.Println(err)
	}
	fmt.Println(*emails[0])
}

The tests should be considered a part of the documentation.

About

Go library for sending mail with the Sendpuse.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Go 100.0%