Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type InvalidAddressError ¶
InvalidAddressError is an error that occurs when an address is invalid.
func (*InvalidAddressError) Error ¶
func (e *InvalidAddressError) Error() string
Error returns the error message.
func (*InvalidAddressError) GRPCStatus ¶
func (e *InvalidAddressError) GRPCStatus() *status.Status
GRPCStatus returns the gRPC status.
type InvalidTemplateError ¶
InvalidTemplateError is an error that occurs when a template is invalid.
func (*InvalidTemplateError) Error ¶
func (e *InvalidTemplateError) Error() string
Error returns the error message.
func (*InvalidTemplateError) GRPCStatus ¶
func (e *InvalidTemplateError) GRPCStatus() *status.Status
GRPCStatus returns the gRPC status.
func (*InvalidTemplateError) Unwrap ¶
func (e *InvalidTemplateError) Unwrap() error
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager is the interface that manages email templates.
func NewManager ¶
func NewManager(d *mailing.Dependencies, pm *mailprovidermanager.Manager) (*Manager, error)
NewManager creates a new Manager.
func (*Manager) Get ¶
func (m *Manager) Get(uid string) (*TemplateParser, bool)
Get returns the template parser with the given UID.
func (*Manager) OnEventCurrentMailingProviderReplaced ¶
OnEventCurrentMailingProviderReplaced is called when the current mailing provider is replaced.
func (*Manager) ReplaceOrInsert ¶
func (m *Manager) ReplaceOrInsert(t *TemplateDefinition) (bool, error)
ReplaceOrInsert replaces or inserts a template definition and creates a new version of it.
func (*Manager) Verify ¶
func (m *Manager) Verify(t *TemplateDefinition) error
Verify verifies the given template definition.
type MissingParameterError ¶
type MissingParameterError struct {
Parameter string
}
MissingParameterError is an error that occurs when a parameter is missing.
func (*MissingParameterError) Error ¶
func (e *MissingParameterError) Error() string
type TemplateDefinition ¶
type TemplateDefinition struct { UID string Name string FromAddress string Subject string Body string Parameters []Parameter }
TemplateDefinition is an email template definition.
type TemplateParser ¶
type TemplateParser struct {
// contains filtered or unexported fields
}
TemplateParser is an email template.
func (*TemplateParser) Parse ¶
func (t *TemplateParser) Parse(in *mailingpb.EnqueuedEmailMessage) (mailprovider2.Message, error)
Parse parses the email template and returns an email message.
func (*TemplateParser) ProviderUpdated ¶
func (t *TemplateParser) ProviderUpdated(p mailprovider.Provider) error
ProviderUpdated updates the email template with the given provider.