Documentation ¶
Index ¶
Constants ¶
const ( MimeTypeHTML = "text/html" MimeTypePlainText = "text/plain" )
Variables ¶
var ( ErrInvalidLicenseExpiryTemplateData = errors.New("invalid license expiration template data") // invalid license expiration template data ErrInvalidOrganizationInviteTemplateData = errors.New("invalid organization invite template data") // invalid organization invite template data ErrInvalidPasswordResetTemplateData = errors.New("invalid password reset template data") // invalid password reset template data ErrInvalidUserWelcomeTemplateData = errors.New("invalid welcome template data") // invalid welcome template data ErrTemplateExecute = errors.New("failed to execute email template") // failed to execute email template ErrTemplateInvalid = errors.New("invalid template") // invalid template ErrTemplateParse = errors.New("failed to parse email template") // failed to parse email template )
Functions ¶
This section is empty.
Types ¶
type LicenseExpiryTemplateData ¶
type LicenseExpiryTemplateData struct { Subject string `validate:"required,min=3,max=50"` LicenseID string `validate:"required"` LicenseEmail string `validate:"required,email"` LicenseOrganization string `validate:"required"` LicenseExpiresAt string `validate:"required"` ServerURL string `validate:"required,url"` RenewEmail string `validate:"required,email"` SupportEmail string `validate:"required,email"` }
LicenseExpiryTemplateData represents the data needed to render the password reset email template.
func (*LicenseExpiryTemplateData) Get ¶
func (d *LicenseExpiryTemplateData) Get() interface{}
Get returns the license expiration email template data.
type OrganizationInviteTemplateData ¶
type OrganizationInviteTemplateData struct { Subject string `validate:"required,min=3,max=50"` Username string `validate:"required,min=3,max=50"` FirstName string `validate:"omitempty,max=50"` OrganizationName string `validate:"required,min=3,max=50"` InvitationURL string `validate:"required,url"` SupportEmail string `validate:"required,email"` }
OrganizationInviteTemplateData represents the data needed to render the invitation email template.
func (*OrganizationInviteTemplateData) Get ¶
func (d *OrganizationInviteTemplateData) Get() interface{}
Get returns the invitation email template data.
type PasswordResetTemplateData ¶
type PasswordResetTemplateData struct { Subject string `validate:"required,min=3,max=50"` Username string `validate:"required,min=3,max=50"` FirstName string `validate:"omitempty,max=50"` PasswordResetURL string `validate:"required,url"` SupportEmail string `validate:"required,email"` }
PasswordResetTemplateData represents the data needed to render the password reset email template.
func (*PasswordResetTemplateData) Get ¶
func (d *PasswordResetTemplateData) Get() interface{}
Get returns the password reset email template data.
type Template ¶
type Template struct { Path string `validate:"required,filepath"` Data TemplateData `validate:"required"` }
Template is a struct that represents the data needed to render an email template.
func NewTemplate ¶
func NewTemplate(path string, data TemplateData) (*Template, error)
NewTemplate returns a new email template.
type TemplateData ¶
type TemplateData interface { // Get returns the template data. Get() any }
TemplateData represents the data needed to render an email template.
type TemplateParserFunc ¶
TemplateParserFunc parses email templates.
type UserWelcomeTemplateData ¶
type UserWelcomeTemplateData struct { Subject string `validate:"required,min=3,max=50"` Username string `validate:"required,min=3,max=50"` FirstName string `validate:"omitempty,max=50"` LoginURL string `validate:"required,url"` SupportEmail string `validate:"required,email"` }
UserWelcomeTemplateData represents the data needed to render the welcome email template.
func (*UserWelcomeTemplateData) Get ¶
func (d *UserWelcomeTemplateData) Get() interface{}
Get returns the welcome email template data.