mailsenders

package
v0.33.0 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MailSender

type MailSender interface {
	Send(ctx context.Context, recipient string, obj any) (id string, err error)
}

type MailgunSender

type MailgunSender struct {
	Mailgun        mailgun.Mailgun
	MailgunBaseUrl string
	SenderAddress  string
	UseTestMode    bool
	Subject        string

	Body *Renderer
}

MailgunSender is a MailSender that sends e-mails via Mailgun.

func NewMailgunSender

func NewMailgunSender(domain string, token string, baseUrl string, senderAddress string, body *Renderer, subject string, useTestMode bool) MailgunSender

func (*MailgunSender) Send

func (m *MailgunSender) Send(ctx context.Context, recipient string, obj any) (string, error)

type Renderer added in v0.25.0

type Renderer struct {
	Template *template.Template
}

func (Renderer) Render added in v0.25.0

func (ir Renderer) Render(obj any) (string, error)

type StdoutSender added in v0.19.0

type StdoutSender struct {
	Subject string
	Body    *Renderer
}

StdoutSender is a MailSender that logs the e-mail to stdout.

func (*StdoutSender) Send added in v0.19.0

func (s *StdoutSender) Send(ctx context.Context, recipient string, obj any) (string, error)

type TemplateData added in v0.25.0

type TemplateData struct {
	Object any
}

Jump to

Keyboard shortcuts

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