Help us shape the future of Go! Take the 2026 Go Developer Survey

maileradapter

package
v1.9.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 2, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package maileradapter provides bridge.Mailer implementations for transactional email delivery (Resend HTTP API and standard SMTP).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ResendMailer

type ResendMailer struct {
	// contains filtered or unexported fields
}

ResendMailer delivers email via the Resend HTTP API.

func NewResendMailer

func NewResendMailer(apiKey, fromAddr string, opts ...ResendOption) *ResendMailer

NewResendMailer creates a Mailer backed by the Resend HTTP API.

func (*ResendMailer) SendEmail

func (m *ResendMailer) SendEmail(ctx context.Context, msg *bridge.EmailMessage) error

SendEmail delivers a message via the Resend API.

type ResendOption

type ResendOption func(*ResendMailer)

ResendOption configures the Resend mailer.

func WithResendBaseURL

func WithResendBaseURL(url string) ResendOption

WithResendBaseURL overrides the Resend API base URL (useful for testing).

func WithResendHTTPClient

func WithResendHTTPClient(c *http.Client) ResendOption

WithResendHTTPClient sets a custom HTTP client (useful for testing).

type SMTPMailer

type SMTPMailer struct {
	// contains filtered or unexported fields
}

SMTPMailer delivers email via standard SMTP.

func NewSMTPMailer

func NewSMTPMailer(host, port, username, password, fromAddr string, opts ...SMTPOption) *SMTPMailer

NewSMTPMailer creates a Mailer backed by standard SMTP.

func (*SMTPMailer) SendEmail

func (m *SMTPMailer) SendEmail(ctx context.Context, msg *bridge.EmailMessage) error

SendEmail delivers a message via SMTP.

type SMTPOption

type SMTPOption func(*SMTPMailer)

SMTPOption configures the SMTP mailer.

func WithSMTPTLS

func WithSMTPTLS(useTLS bool) SMTPOption

WithSMTPTLS enables TLS for the SMTP connection.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL