emailreminders

package
v1.77.1-rc Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2023 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Chore

type Chore struct {
	Loop *sync2.Cycle
	// contains filtered or unexported fields
}

Chore checks whether any emails need to be re-sent.

architecture: Chore

func NewChore

func NewChore(log *zap.Logger, tokens *consoleauth.Service, usersDB console.Users, mailservice *mailservice.Service, config Config, address string) *Chore

NewChore instantiates Chore.

func (*Chore) Close

func (chore *Chore) Close() error

Close closes chore.

func (*Chore) Run

func (chore *Chore) Run(ctx context.Context) (err error)

Run starts the chore.

func (*Chore) TestSetLinkAddress

func (chore *Chore) TestSetLinkAddress(address string)

TestSetLinkAddress allows the email link address to be reconfigured. The address points to the satellite web server's external address. In the test environment the external address is not set by a config. It is an internal address, and we don't know what the port is until after it has been assigned. With this method, we get the address from the api in testplanet and assign it here.

func (*Chore) TestUseBlockingSend

func (chore *Chore) TestUseBlockingSend()

TestUseBlockingSend allows us to set the chore to use a blocking send method. Using a blocking send method allows us to test that links are clicked without potential race conditions.

type Config

type Config struct {
	FirstVerificationReminder  time.Duration `help:"amount of time before sending first reminder to users who need to verify their email" default:"24h"`
	SecondVerificationReminder time.Duration `help:"amount of time before sending second reminder to users who need to verify their email" default:"120h"`
	ChoreInterval              time.Duration `help:"how often to send reminders to users who need to verify their email" default:"24h"`
	Enable                     bool          `help:"enable sending emails reminding users to verify their email" default:"true"`
}

Config contains configurations for email reminders.

Jump to

Keyboard shortcuts

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