Package io.micronaut.email.template
Interface TemplateBodyDecorator
- All Superinterfaces:
EmailDecorator
,io.micronaut.core.order.Ordered
- All Known Implementing Classes:
DefaultTemplateBodyDecorator
@DefaultImplementation(DefaultTemplateBodyDecorator.class)
public interface TemplateBodyDecorator
extends EmailDecorator
Decorates emails whose text or html is of type
TemplateBody
by rendering those templates.- Since:
- 1.0.0
- Author:
- Sergio del Amo
-
Field Summary
Fields inherited from interface io.micronaut.core.order.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
-
Method Summary
Modifier and TypeMethodDescriptiondefault void
decorate
(Email.Builder emailBuilder) Populates an email.org.slf4j.Logger
default void
renderBody
(@NonNull TemplateBody<?> body, @NonNull BodyType bodyType) @NonNull Optional<io.micronaut.views.ViewsRenderer>
resolveViewsRenderer
(@NonNull BodyType bodyType, @NonNull String viewName, @Nullable Object data) Methods inherited from interface io.micronaut.core.order.Ordered
getOrder
-
Method Details
-
getLogger
org.slf4j.Logger getLogger() -
resolveViewsRenderer
@NonNull @NonNull Optional<io.micronaut.views.ViewsRenderer> resolveViewsRenderer(@NonNull @NonNull BodyType bodyType, @NonNull @NonNull String viewName, @Nullable @Nullable Object data) - Parameters:
bodyType
- Emails Body typeviewName
- template view namedata
- Template Model- Returns:
- The view rendered to be used
-
decorate
Description copied from interface:EmailDecorator
Populates an email.- Specified by:
decorate
in interfaceEmailDecorator
- Parameters:
emailBuilder
- Email Builder
-
renderBody
default void renderBody(@NonNull @NonNull TemplateBody<?> body, @NonNull @NonNull BodyType bodyType) - Parameters:
body
- Template BodybodyType
- Body Type
-