Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/troygoode/courier-swu-shim-go

Golang shim to send Courier messages with a SWU-esque API
https://github.com/troygoode/courier-swu-shim-go

Last synced: about 5 hours ago
JSON representation

Golang shim to send Courier messages with a SWU-esque API

Awesome Lists containing this project

README

        

# courier-swu-shim-go

Golang shim to send Courier messages with a SWU-esque API

## Using this shim

```golang
var recipientName *string
var cc []string

recipientEmail := os.Getenv("SHIM_EMAIL_TO")
recipientName = nil
templateID := os.Getenv("SHIM_TEMPLATE_ID")
cc = nil
bccTeam := false

tmplParams := make(map[string]interface{})
tmplParams["orgName"] = "Example"
tmplParams["name"] = "Jane Doe"
tmplParams["email"] = "[email protected]"
tmplParams["inviteUrl"] = "Example"

shim := swushim.CreateClient(&swushim.CourierClientOptions{
// AuthToken: &authToken, // OPTIONAL: will default to COURIER_AUTH_TOKEN environment variable
TeamEmails: []string{"[email protected]"}, // email addresses to be used when bccTeam=true
})
err := shim.SendEmail(recipientEmail, recipientName, templateID, cc, bccTeam, tmplParams)
```

## License
The package is available as open source under the terms of the MIT License.

[MIT License](http://www.opensource.org/licenses/mit-license.php)