Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultPreviewer = &Previewer{
Prefix: "/emailpreviews",
}
DefaultPreviewer is the default previewer.
Functions ¶
This section is empty.
Types ¶
type HermesRenderer ¶
HermesRenderer takes a hermes template and uses that to render a message.
type Message ¶
type Message struct { To []string From string FromPretty string Body string BodyHTML string Subject string }
Message is basic structure for notification system.
type Previewer ¶
type Previewer struct { Data map[string]hermes.Email Prefix string URLPrefix string Renderer Renderer // contains filtered or unexported fields }
Previewer is an HTTP handler that renders previews of email templates.
type Renderer ¶
type Renderer interface { // Render returns the plain text email body, html email body, and an error. Render(tmpl hermes.Email) (string, string, error) }
Renderer is an interface for rendering emails.
type SenderMock ¶
type SenderMock struct { // SendFunc mocks the Send method. SendFunc func(msg Message) error // contains filtered or unexported fields }
SenderMock is a mock implementation of Sender.
func TestSomethingThatUsesSender(t *testing.T) { // make and configure a mocked Sender mockedSender := &SenderMock{ SendFunc: func(msg Message) error { panic("TODO: mock out the Send method") }, } // TODO: use mockedSender in code that requires Sender // and then make assertions. }
func (*SenderMock) SendCalls ¶
func (mock *SenderMock) SendCalls() []struct { Msg Message }
SendCalls gets all the calls that were made to Send. Check the length with:
len(mockedSender.SendCalls())
Source Files ¶
Click to show internal directories.
Click to hide internal directories.