Skip to content

Instantly share code, notes, and snippets.

@luizbranco luizbranco/mailer.go
Last active Feb 20, 2018

Embed
What would you like to do?
Loading mailer intefaces
func NewMailer() (Mailer, error) {
key := os.Get("MAILGUN_API_KEY")
if key != "" {
return // Mailgun client or an error
}
key = os.GET("SENDGRID_API_KEY")
if key != "" {
return // SendGrid client or an error
}
return nil, errors.New("No email service configured")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.