This section is empty.


This section is empty.


This section is empty.


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,
    	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

        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)

            Source Files