Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/troygoode/courier-swu-shim-go
- Owner: troygoode
- License: mit
- Created: 2020-06-26T05:10:20.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2020-06-27T00:05:28.000Z (over 4 years ago)
- Last Synced: 2024-06-20T17:47:15.418Z (5 months ago)
- Language: Go
- Size: 202 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
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 []stringrecipientEmail := os.Getenv("SHIM_EMAIL_TO")
recipientName = nil
templateID := os.Getenv("SHIM_TEMPLATE_ID")
cc = nil
bccTeam := falsetmplParams := 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)