Giter Club home page Giter Club logo

sendpulse-sdk-go's Introduction

SendPulse REST client library (unofficial)

An unofficial SendPulse SDK client library for Go (Golang). This library allows to use the SendPulse API via Go.

SendPulse API official documentation https://sendpulse.com/api

Build Status codecov Go Report Card License

Installation

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

Usage

package main

import (
    "context"
    "fmt"
    sendpulse "github.com/dimuska139/sendpulse-sdk-go/v7"
    "net/http"
)

func main() {
    config := &sendpulse.Config{
        UserID: "",
        Secret: "",
    }
    client := sendpulse.NewClient(http.DefaultClient, config)

    emails := []*sendpulse.EmailToAdd {
        &sendpulse.EmailToAdd{
            Email:     "[email protected]",
            Variables: map[string]interface{}{"age": 21, "weight": 99},
        },
    }
    
    ctx := context.Background()
    if err := client.Emails.MailingLists.SingleOptIn(ctx, 1266208, emails); err != nil {
        fmt.Println(err)
    }
    fmt.Println(*emails[0])
}

The tests should be considered a part of the documentation.

License

The MIT License (MIT)

sendpulse-sdk-go's People

Contributors

dimuska139 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.