mailsenders

package
v0.24.0 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type InvitationRenderer added in v0.19.0

type InvitationRenderer struct {
	Template *template.Template
}

func (InvitationRenderer) Render added in v0.19.0

func (ir InvitationRenderer) Render(inv userv1.Invitation) (string, error)

type MailSender

type MailSender interface {
	Send(ctx context.Context, recipient string, inv userv1.Invitation) (id string, err error)
}

type MailgunSender

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

	Body *InvitationRenderer
}

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

func NewMailgunSender

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

func (*MailgunSender) Send

func (m *MailgunSender) Send(ctx context.Context, recipient string, inv userv1.Invitation) (string, error)

type StdoutSender added in v0.19.0

type StdoutSender struct {
	Subject string
	Body    *InvitationRenderer
}

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, inv userv1.Invitation) (string, error)

Jump to

Keyboard shortcuts

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