Buffalo's sender implementation for Sendgrid in Go
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore initial commit Sep 6, 2018
Gopkg.lock initial commit Sep 6, 2018
Gopkg.toml initial commit Sep 6, 2018
README.md Update README.md Sep 6, 2018
go.mod initial commit Sep 6, 2018
go.sum initial commit Sep 6, 2018
sendgrid_sender.go Preserve the From/To names Nov 10, 2018

README.md

Sendgrid Buffalo Sender

This is a buffalo sender for the Sendgrid email service.

How to use

In your mailers.go

import (
    ... 
    ssender "github.com/paganotoni/sendgrid-sender"
)

var sender mail.Sender

func init() {
	APIKey := envy.Get("SENDGRID_API_KEY", "")
	sender = ssender.NewSendgridSender(APIKey)
}

And then in your mailers you would do the same sender.Send(m) as this sender matches buffalos mail.Sender interface.

Test mode

Whenever the GO_ENV variable is set to be test this sender will use mocksmtp sender to send messages, you can read values in your tests within the property TestSender of the SendgridSender.