Tools / Postmark-sender

Postmark-sender

Postmark Buffalo Email Sender

Forks: 0
Watchers: 1
Stars: 0

Postmark Buffalo Sender

This is a buffalo sender for the postmark transactional email service.

How to use

In your mailers.go

import psender "github.com/paganotoni/postmark-sender"
...

var sender mail.Sender
var hcomposer hermes.Hermes

func init() {
	sender = psender.NewPostMarkSender(envy.Get("POSTMARK_SERVER_TOKEN", ""), envy.Get("POSTMARK_ACCOUNT_TOKEN", ""), false)
}

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 PostmarkSender.

License: -