21 lines
653 B
Go
21 lines
653 B
Go
//go:build e2e
|
|
|
|
package resend
|
|
|
|
import "time"
|
|
|
|
const e2eEndpoint = "http://mail-fixture:8025/emails"
|
|
|
|
// NewE2ESender is compiled only into the isolated registration E2E image. Its
|
|
// endpoint is fixed to the Compose fixture and cannot be selected at runtime.
|
|
func NewE2ESender(apiKey, from string, timeout time.Duration) (*Sender, error) {
|
|
sender, err := newSender(apiKey, from, timeout, e2eEndpoint, time.Now)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
// The local fixture must stay internal even when the host has proxy
|
|
// variables configured for ordinary provider traffic.
|
|
sender.client = newHTTPClientWithProxy(timeout, nil)
|
|
return sender, nil
|
|
}
|