https://github.com/paganotoni/postmark-sender
Postmark Buffalo Email Sender
https://github.com/paganotoni/postmark-sender
buffalo gobuffalo mailer
Last synced: about 2 months ago
JSON representation
Postmark Buffalo Email Sender
- Host: GitHub
- URL: https://github.com/paganotoni/postmark-sender
- Owner: paganotoni
- Created: 2018-06-23T15:37:27.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2019-01-02T16:10:43.000Z (almost 7 years ago)
- Last Synced: 2025-02-28T22:33:21.890Z (7 months ago)
- Topics: buffalo, gobuffalo, mailer
- Language: Go
- Size: 3.51 MB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
### Postmark Buffalo Sender
This is a [buffalo](github.com/gobuffalo/buffalo) sender for the [postmark](https://postmarkapp.com/) transactional email service.
#### How to use
In your `mailers.go`
```go
import psender "github.com/paganotoni/postmark-sender"
...var sender mail.Sender
var hcomposer hermes.Hermesfunc 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`](https://github.com/gobuffalo/buffalo/blob/master/mail/mail.go#L4) interface.
#### Test mode
Whenever the GO_ENV variable is set to be `test` this sender will use [mocksmtp](https://github.com/stanislas-m/mocksmtp) sender to send messages, you can read values in your tests within the property `TestSender` of the PostmarkSender.