Documentation ¶
Overview ¶
Package email provides email sending functionality.
Index ¶
- type Manager
- func (m *Manager) SendAccountActivation(ctx context.Context, eml, tok string)
- func (m *Manager) SendAccountDeleted(ctx context.Context, eml string)
- func (m *Manager) SendAccountRecovery(ctx context.Context, eml, tok string)
- func (m *Manager) SendEmailChanged(ctx context.Context, oEml, nEml string)
- func (m *Manager) SendEmailVerification(ctx context.Context, eml, tok string)
- func (m *Manager) SendPasswordChanged(ctx context.Context, eml string, recov bool)
- type Placeholder
- func (p Placeholder) SendAccountActivation(_ context.Context, eml, tok string)
- func (p Placeholder) SendAccountDeleted(ctx context.Context, eml string)
- func (p Placeholder) SendAccountRecovery(_ context.Context, eml, tok string)
- func (p Placeholder) SendEmailChanged(_ context.Context, oEml, nEml string)
- func (p Placeholder) SendEmailVerification(_ context.Context, eml, tok string)
- func (p Placeholder) SendPasswordChanged(ctx context.Context, eml string, recov bool)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager holds data needed to send emails to the users.
func NewManager ¶
func NewManager(log zerolog.Logger, host, username, password, from string, herm hermes.Hermes, l httpflow.Links) (*Manager, error)
NewManager creates a fresh instance of email manager.
func (*Manager) SendAccountActivation ¶
SendAccountActivation sends an email regarding account activation with the token, embedded into a full URL, to the specified email address.
func (*Manager) SendAccountDeleted ¶
SendAccountDeleted sends an email regarding successful account deletion to the specified email address.
func (*Manager) SendAccountRecovery ¶
SendAccountRecovery sends an email regarding account recovery with the token, embedded into a full URL, to the specified email address.
func (*Manager) SendEmailChanged ¶
SendEmailChanged sends an email to the old email address (first parameter) about a new email address being set (second parameter).
func (*Manager) SendEmailVerification ¶
SendEmailVerification sends an email regarding new email verification with the token, embedded into a full URL, to the specified email address.
func (*Manager) SendPasswordChanged ¶
SendPasswordChanged sends an email notifying about a successful password change to the specified email address. Last parameter specifies whether the password was changed during the recovery process or not.
type Placeholder ¶
type Placeholder struct {
// contains filtered or unexported fields
}
Placeholder is a drop-in no-op replacement of a working email sender.
func NewPlaceholder ¶
func NewPlaceholder(log zerolog.Logger, ll httpflow.Links) Placeholder
NewPlaceholder creates a new email service placeholder instance.
func (Placeholder) SendAccountActivation ¶
func (p Placeholder) SendAccountActivation(_ context.Context, eml, tok string)
SendAccountActivation should send an email regarding account activation with the token, embedded into a full URL, to the specified email address.
func (Placeholder) SendAccountDeleted ¶
func (p Placeholder) SendAccountDeleted(ctx context.Context, eml string)
SendAccountDeleted should send an email regarding successful account deletion to the specified email address.
func (Placeholder) SendAccountRecovery ¶
func (p Placeholder) SendAccountRecovery(_ context.Context, eml, tok string)
SendAccountRecovery should send an email regarding account recovery with the token, embedded into a full URL, to the specified email address.
func (Placeholder) SendEmailChanged ¶
func (p Placeholder) SendEmailChanged(_ context.Context, oEml, nEml string)
SendEmailChanged should send an email to the old email address (first parameter) about a new email address being set (second parameter).
func (Placeholder) SendEmailVerification ¶
func (p Placeholder) SendEmailVerification(_ context.Context, eml, tok string)
SendEmailVerification should send an email regarding new email verification with the token, embedded into a full URL, to the specified email address.
func (Placeholder) SendPasswordChanged ¶
func (p Placeholder) SendPasswordChanged(ctx context.Context, eml string, recov bool)
SendPasswordChanged should send an email notifying about a successful password change to the specified email address. Last parameter specifies whether the password was changed during the recovery process or not.