Documentation
¶
Overview ¶
Package mailtrap provides a notify.Notifier implementation that sends transactional emails through the Mailtrap Email Sending API.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Mailtrap ¶
type Mailtrap struct {
// contains filtered or unexported fields
}
Mailtrap holds the data required to communicate with the Mailtrap Email Sending API.
func New ¶
New returns a new instance of a Mailtrap notification service. You will need a Mailtrap API token, which can be created at https://mailtrap.io/api-tokens. See https://api-docs.mailtrap.io for the full API documentation.
func (*Mailtrap) AddReceivers ¶
AddReceivers takes email addresses and adds them to the internal address list. The Send method will send a given message to all those addresses.
func (*Mailtrap) BodyFormat ¶
BodyFormat can be used to specify the format of the message body. Default BodyType is HTML.
type Option ¶
type Option func(*Mailtrap)
Option describes a functional parameter for the Mailtrap constructor.
func WithBulkHost ¶
func WithBulkHost() Option
WithBulkHost routes messages through the Mailtrap bulk sending host, which is intended for high-volume sending.
func WithHTTPClient ¶
WithHTTPClient sets a custom HTTP client for communicating with the Mailtrap API. This is useful for configuring timeouts, proxies, or custom transports.
func WithHost ¶
WithHost overrides the Mailtrap API host. This is primarily useful for testing or for pointing the client at a custom endpoint.
func WithSandbox ¶
WithSandbox routes messages through the Mailtrap sandbox host, capturing emails in the given test inbox instead of delivering them. The sandbox API requires the inbox ID as part of the request path, so it must be provided here. See https://api-docs.mailtrap.io for details.
func WithSenderName ¶
WithSenderName sets the display name used for the sender ("from") address. If not set, only the sender email address is sent.