https://github.com/sideshow/sailthru-go
Go-based Sailthru API integration
https://github.com/sideshow/sailthru-go
Last synced: 5 months ago
JSON representation
Go-based Sailthru API integration
- Host: GitHub
- URL: https://github.com/sideshow/sailthru-go
- Owner: sideshow
- License: mit
- Created: 2017-08-11T23:08:41.000Z (over 8 years ago)
- Default Branch: develop
- Last Pushed: 2017-08-22T22:26:04.000Z (over 8 years ago)
- Last Synced: 2025-10-09T06:06:43.911Z (5 months ago)
- Language: Go
- Homepage:
- Size: 20.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Sailthru-Go
An unauthorized, and not guaranteed to work for you, implementation of the [Sailthru API](https://getstarted.sailthru.com/developers/overview/) in Go. Not all methods are currently implemented; they will be added as we need them. Pull requests welcomed.
## Examples
### Send
Sailthru [Template](https://getstarted.sailthru.com/developers/api/send/#POST_to_Send_Schedule_or_Update) docs
```go
client := sailthru.NewClient(key, secret)
vars := map[string]string{"name": "Bob", "welcome": "Hello!"}
params := ¶ms.Send{
Email: "you@example.org",
Template: "A-Template",
Vars: vars,
}
res, err := client.Send(params)
```
You can also set a schedule time;
```go
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](https://getstarted.sailthru.com/developers/api/job/#update) docs
```go
client := sailthru.NewClient(key, secret)
params := ¶ms.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)
```