emails

package
v0.0.0-...-476b611 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetCurrentUnsubscriptionsByUserID

func GetCurrentUnsubscriptionsByUserID(ctx context.Context, userID persist.DBID) (persist.EmailUnsubscriptions, error)

func RequestVerificationEmail

func RequestVerificationEmail(ctx context.Context, userID persist.DBID) error

func UnsubscribeByJWT

func UnsubscribeByJWT(ctx context.Context, jwt string, unsubTypes []model.EmailUnsubscriptionType) error

func UpdateUnsubscriptionsByUserID

func UpdateUnsubscriptionsByUserID(ctx context.Context, userID persist.DBID, unsubTypes persist.EmailUnsubscriptions) error

Types

type GetSubscriptionsResponse

type GetSubscriptionsResponse struct {
	Unsubscriptions persist.EmailUnsubscriptions `json:"unsubscriptions"`
}

type GetUnsubscriptionsInput

type GetUnsubscriptionsInput struct {
	UserID persist.DBID `form:"user_id" binding:"required"`
}

type PreverifyEmailInput

type PreverifyEmailInput struct {
	Email  persist.Email `form:"email" binding:"required"`
	Source string        `form:"source" binding:"required"`
}

type PreverifyEmailOutput

type PreverifyEmailOutput struct {
	Result PreverifyEmailResult `json:"result"`
}

func PreverifyEmail

func PreverifyEmail(ctx context.Context, email persist.Email, source string) (PreverifyEmailOutput, error)

type PreverifyEmailResult

type PreverifyEmailResult int
const (
	PreverifyEmailResultInvalid PreverifyEmailResult = iota
	PreverifyEmailResultRisky
	PreverifyEmailResultValid
)

type ResubInput

type ResubInput struct {
	JWT    string                          `json:"jwt" binding:"required"`
	Resubs []model.EmailUnsubscriptionType `json:"resubscriptions" binding:"required"`
}

type UnsubInput

type UnsubInput struct {
	JWT    string                          `json:"jwt" binding:"required"`
	Unsubs []model.EmailUnsubscriptionType `json:"unsubscriptions" binding:"required"`
}

type UpdateUnsubscriptionsTypeInput

type UpdateUnsubscriptionsTypeInput struct {
	UserID persist.DBID                 `json:"user_id" binding:"required"`
	Unsubs persist.EmailUnsubscriptions `json:"unsubscriptions" binding:"required"`
}

type VerificationEmailInput

type VerificationEmailInput struct {
	UserID persist.DBID `json:"user_id" binding:"required"`
}

type VerifyEmailInput

type VerifyEmailInput struct {
	JWT string `json:"jwt" binding:"required"`
}

type VerifyEmailOutput

type VerifyEmailOutput struct {
	UserID persist.DBID  `json:"user_id"`
	Email  persist.Email `json:"email"`
}

func VerifyEmail

func VerifyEmail(ctx context.Context, token string) (VerifyEmailOutput, error)

Jump to

Keyboard shortcuts

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