# README
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
Note: If either StartTime
or EndTime
is set, then ScheduleTime
is ignored (even if also set).
client := sailthru_client.NewClient(key, secret)
send := sailthru_send.NewSingle(client)
// send.Params.CC = "[email protected]"
// send.Params.BCC = "[email protected]"
// send.Params.ReplyTo = "[email protected]"
// send.Params.Test = true
// send.Params.DataFeedURL = "https://some-bucket.s3.amazonaws.com/path/to/feed"
// send.Params.BehalfOf = "[email protected]"
// send.Params.ScheduleTime = "2006-01-02 15:04:05 UTC"
// send.Params.StartTime = "2006-01-02 15:04:05 UTC"
// send.Params.EndTime = = "2006-01-02 15:04:05 UTC"
vars := map[string]string{"name": "Bob", "welcome": "Hello!"}
send.Deliver("[email protected]", "A-Template", vars)
Job
client := sailthru_client.NewClient(key, secret)
updater := sailthru_job.NewUpdate(client)
updater.Params.PostbackURL = "http://example.org/webhooks"
updater.Params.ReportEmail = '[email protected]'
updater.Params.IncludeSignupDate = true
updater.ProcessURL("https://some-bucket.s3.amazonaws.com/path/to/file1.csv")
updater.ProcessURL("https://some-bucket.s3.amazonaws.com/path/to/file2.csv")