Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- sendgrid.go: error:net/http: Client Transport of type init.failingTransport doesn't support CancelRequest; Timeout not supported; response:<nil>
- sg := sendgrid.NewSendGridClientWithApiKey("string")
- email := sendgrid.NewMail()
- email.AddTo(req.Email)
- email.SetSubject("Confirm your registration at domain")
- email.SetFrom("noreply@domain.com")
- email.SetFromName("domain")
- email.SetText(url)
- if r := sg.Send(email); r == nil {
- log.Infof(ctx, "email sent")
- } else {
- log.Errorf(ctx, "email not sent %v", r)
- w.WriteHeader(http.StatusInternalServerError)
- return
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement