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)
| 89 | |
| 90 | // GetTemplate returns a registered template from the registry in the context (if available), otherwise falling back to the default registry. |
| 91 | func 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. |
| 101 | type Template struct { |