email

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2015 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 UserEmailer

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

UserEmailer provides functions for sending emails to Users.

func NewUserEmailer

func NewUserEmailer(ur user.UserRepo,
	pwi user.PasswordInfoRepo,
	signerFn signerFunc,
	tokenValidityWindow time.Duration,
	issuerURL url.URL,
	emailer *email.TemplatizedEmailer,
	fromAddress string,
	passwordResetURL url.URL,
	verifyEmailURL url.URL,
	invitationURL url.URL,
) *UserEmailer

NewUserEmailer creates a new UserEmailer.

func (*UserEmailer) SendEmailVerification

func (u *UserEmailer) SendEmailVerification(userID, clientID string, redirectURL url.URL) (*url.URL, error)

SendEmailVerification sends an email to the user with the given userID containing a link which when visited marks the user as having had their email verified. If there is no emailer is configured, the URL of the aforementioned link is returned, otherwise nil is returned.

func (*UserEmailer) SendInviteEmail added in v0.2.0

func (u *UserEmailer) SendInviteEmail(email string, redirectURL url.URL, clientID string) (*url.URL, error)

SendInviteEmail is sends an email that allows the user to both reset their password *and* verify their email address. Similar to SendResetPasswordEmail, the given url and client id are assumed valid. A link that can be used to validate the given email address and reset the password is returned.

func (*UserEmailer) SendResetPasswordEmail

func (u *UserEmailer) SendResetPasswordEmail(email string, redirectURL url.URL, clientID string) (*url.URL, error)

SendResetPasswordEmail sends a password reset email to the user specified by the email addresss, containing a link with a signed token which can be visitied to initiate the password change/reset process. This method DOES NOT check for client ID, redirect URL validity - it is expected that upstream users have already done so. A link that can be used to reset the given user's password is returned.

func (*UserEmailer) SetEmailer

func (u *UserEmailer) SetEmailer(emailer *email.TemplatizedEmailer)

Jump to

Keyboard shortcuts

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