forked from gsamokovarov/sg
-
Notifications
You must be signed in to change notification settings - Fork 0
/
doc.go
33 lines (33 loc) · 1011 Bytes
/
doc.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
// Package sg provides simple transactional mails clients for SendGrid and
// SparkPost.
//
// The simplest way to send a mail is through `sg.Send` which uses a global client:
//
// func main() {
// // If you have your key in the SG_API_KEY environment variable, you may
// // skip this step.
// sg.Setup(sg.NewClient("API_KEY"))
//
// sg.Send(&sg.Mail{
// TemplateId: "c2723c5e-b693-4086-968f-bd9057cc6ae4",
// From: "[email protected]",
// To: "[email protected]",
// Substitutions: sg.H{"SUB": "value"},
// })
// }
//
// If you don't want to use a global client, you can build your own:
//
// func main() {
// // If you have your key in the SG_API_KEY environment variable, you may
// // skip this step.
// client := sg.NewClient("API_KEY")
//
// client.Send(&sg.Mail{
// TemplateId: "c2723c5e-b693-4086-968f-bd9057cc6ae4",
// From: "[email protected]",
// To: "[email protected]",
// Substitutions: sg.H{"SUB": "value"},
// })
// }
package sg