email

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 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,
) *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) 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. If there is no emailer is configured, the URL of the aforementioned link is returned, otherwise nil 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