Skip to content

sideshow/sailthru-go

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sailthru-Go

An unauthorized, and not guaranteed to work for you, implementation of the Sailthru API in Go. Not all methods are currently implemented; they will be added as we need them. Pull requests welcomed.

Examples

Send

Sailthru Template docs

client := sailthru.NewClient(key, secret)

vars := map[string]string{"name": "Bob", "welcome": "Hello!"}

params := &params.Send{
  Email:    "you@example.org",
  Template: "A-Template",
  Vars:     vars,
}

res, err := client.Send(params)

You can also set a schedule time;

params.ScheduleTime = &ScheduleTime{
  StartTime: "Tue, 27 Jul 2010 12:10:00 -0400",
  EndTime: "Tue, 28 Jul 2010 12:10:00 -0400", //Optional
}

Job

Sailthru Update Job docs

client := sailthru.NewClient(key, secret)

params := &params.UpdateJob{
  PostbackURL:       "http://example.org/webhooks",
  ReportEmail:       "you@example.org",
  IncludeSignupDate: true,
  URL:               "https://some-bucket.s3.amazonaws.com/path/to/file1.json",
}

res, err := client.ProcessUpdateJob(params)

About

Go-based Sailthru API integration

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages