email

package
v0.0.0-...-06572e6 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var PendingConfirmationEmailRegisterCache *utils.TtlMap[string, PendingConfirmationEmail]
View Source
var PendingResetPassCache *utils.TtlMap[string, PendingResetPass]

Functions

func GenerateOtpAndAct

func GenerateOtpAndAct(secret string, cbfn func(string)) *result.Error

Generates an OTP code with provided secret and launches a goroutine of a callback function.

func SendEmailResetPassword

func SendEmailResetPassword(targetEmail string, resetPassCode string, userId string) *result.Error

Sends an OTP code for reset password to the target email.

func SendEmailVerification

func SendEmailVerification(targetEmail string, emailVerificationUrlCode string, userId string) *result.Error

Sends a OTP code for email verification to the target email.

func StartEmailService

func StartEmailService()

Loads verification and reset pass email HTML template files to the cache.

"email/verification.html"
"email/resetpass.html"

Starts 2 goroutines for ttlmap user register and resetting passwords.

Types

type EmailVerificationArgs

type EmailVerificationArgs struct {
	AppName         string
	AppRootUrl      string
	UserId          string
	VerifyEmailCode string
}

type PendingConfirmationEmail

type PendingConfirmationEmail struct {
	VerificationCode string
	UserToCreate     *db.RequiredUser
}

type PendingResetPass

type PendingResetPass struct {
	OTPCode     string
	User        *db.User
	NewPassword string
}

type ResetPassArgs

type ResetPassArgs struct {
	AppName       string
	AppRootUrl    string
	UserId        string
	ResetPassCode string
}

Jump to

Keyboard shortcuts

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