emailtemplates

package
v0.0.0-...-6aee27a Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EmailContent

type EmailContent struct {
	Subject           string
	PlaintTextContent string
	HTMLContent       string
}

func BuildEmailContent

func BuildEmailContent(emailTemplate EmailTemplate, templateData EmailTemplateData) (EmailContent, error)

BuildEmailContent constructs an email subject and body from the given template and template data. Returns (body, subject, nil) if there is no error generating the content, otherwise ("", "", error)

type EmailTemplate

type EmailTemplate = string

EmailTemplate is an enum describing each of the possible email types

const (
	// EmailRecoveryTemplate contains a message indicating that a user can recover their account
	EmailRecoveryTemplate EmailTemplate = "self-service-recovery-email"

	// EmailRecoveryDeniedTemplate contains a message indicating that a user CANNOT recover their
	// account because it's disabled
	EmailRecoveryDeniedTemplate EmailTemplate = "self-service-recovery-denied-email"
)

type EmailTemplateData

type EmailTemplateData struct {
	UserRecord *models.User
	DB         *database.Connection
}

Jump to

Keyboard shortcuts

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