Adding OutboxService for use in tests, etc.
1 files changed, 18 insertions(+), 0 deletions(-) A => outbox.go
A => outbox.go +18 -0
@@ 0,0 1,18 @@ +package carrier + +// OutboxService is a simple email service to store messages in a +// slice for use in tests, etc. +type OutboxService struct { + msgs []*Message +} + +// Send match email Service interface signature +func (c *OutboxService) Send(msg *Message) error { + c.msgs = append(c.msgs, msg) + return nil +} + +// NewOutboxService returns an smtp service instance +func NewOutboxService() *OutboxService { + return &OutboxService{msgs: []*Message{}} +}