Documentation ¶
Index ¶
- type EmailHelper
- func (s *EmailHelper) ChangePasswordAuth(ctx context.Context, params SendEmail) error
- func (s *EmailHelper) CreateEmailAuth(ctx context.Context, email string) (uuid.UUID, error)
- func (s *EmailHelper) SendEmail(types NotifType, params ...string) error
- func (s *EmailHelper) SendEmailWithNotif(ctx context.Context, params SendEmail) error
- func (s *EmailHelper) VerifyEmailAuth(ctx context.Context, uid string, token int) (bool, error)
- type NotifBody
- type NotifHeader
- type NotifType
- type SendEmail
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EmailHelper ¶
type EmailHelper struct {
// contains filtered or unexported fields
}
func NewEmailHelper ¶
func NewEmailHelper(store db.PostgresStore, redis redis.Store, cfg util.Config) *EmailHelper
func (*EmailHelper) ChangePasswordAuth ¶
func (s *EmailHelper) ChangePasswordAuth(ctx context.Context, params SendEmail) error
func (*EmailHelper) CreateEmailAuth ¶
func (*EmailHelper) SendEmail ¶
func (s *EmailHelper) SendEmail(types NotifType, params ...string) error
NotifType is the type of notification params[0] = email address, params[1] = ip address/token, params[2] = uuid params[2] is required for signup only
func (*EmailHelper) SendEmailWithNotif ¶
func (s *EmailHelper) SendEmailWithNotif(ctx context.Context, params SendEmail) error
func (*EmailHelper) VerifyEmailAuth ¶
type NotifBody ¶
type NotifBody string
const ( NotifBodyLogin NotifBody = "Your account was just accessed from a %v. If you did not initiate this login, please reset your password immediately." NotifBodySignUp NotifBody = `` /* 458-byte string literal not displayed */ NotifBodyChangePass NotifBody = `` /* 375-byte string literal not displayed */ NotifBodyPassChanging NotifBody = `` /* 305-byte string literal not displayed */ )
type NotifHeader ¶
type NotifHeader string
const ( NotifHeaderLogin NotifHeader = "Login Notification" NotifHeaderSignUp NotifHeader = "Welcome to Project!" NotifHeaderChangePass NotifHeader = "Password Changed" )
type NotifType ¶
type NotifType string
const ( NotifTypeLike NotifType = "like" NotifTypeComment NotifType = "comment" NotifTypeFollow NotifType = "follow" NotifTypeMention NotifType = "mention" NotifTypeRetweet NotifType = "retweet" NotifTypeLogin NotifType = "login" NotifTypeAds NotifType = "ads" NotifTypeSignUp NotifType = "signup" NotifTypeChangePass NotifType = "password change" NotifTypePassChanging NotifType = "password-changing" )
Click to show internal directories.
Click to hide internal directories.