github.com/blend/go-sdk@v1.20220411.3/email/mock_sender.go (about) 1 /* 2 3 Copyright (c) 2022 - Present. Blend Labs, Inc. All rights reserved 4 Use of this source code is governed by a MIT license that can be found in the LICENSE file. 5 6 */ 7 8 package email 9 10 import "context" 11 12 // NewMockSender creates a new mock sender. 13 func NewMockSender() MockSender { 14 return MockSender(make(chan Message)) 15 } 16 17 // MockSender is a mocked sender. 18 type MockSender chan Message 19 20 // Send sends a mocked message. 21 func (ms MockSender) Send(ctx context.Context, m Message) error { 22 ms <- m 23 return nil 24 }