MCPcopy Create free account
hub / github.com/TheThingsNetwork/lorawan-stack / GetTemplate

Function GetTemplate

pkg/email/template.go:91–98  ·  view source on GitHub ↗

GetTemplate returns a registered template from the registry in the context (if available), otherwise falling back to the default registry.

(ctx context.Context, name string)

Source from the content-addressed store, hash-verified

89
90// GetTemplate returns a registered template from the registry in the context (if available), otherwise falling back to the default registry.
91func GetTemplate(ctx context.Context, name string) *Template {
92 if reg, ok := templateRegistryFromContext(ctx); ok {
93 if tmpl := reg.GetTemplate(ctx, name); tmpl != nil {
94 return tmpl
95 }
96 }
97 return defaultTemplateRegistry.GetTemplate(ctx, name)
98}
99
100// Template is the template for an email message.
101type Template struct {

Callers 4

TestEmailTemplatesFunction · 0.92

Calls 2

GetTemplateMethod · 0.65

Tested by 2

TestEmailTemplatesFunction · 0.74