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 Type
    Method
    Description
    default 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 type
      viewName - template view name
      data - Template Model
      Returns:
      The view rendered to be used
    • decorate

      default void decorate(@NonNull @NotNull Email.Builder emailBuilder)
      Description copied from interface: EmailDecorator
      Populates an email.
      Specified by:
      decorate in interface EmailDecorator
      Parameters:
      emailBuilder - Email Builder
    • renderBody

      default void renderBody(@NonNull @NonNull TemplateBody<?> body, @NonNull @NonNull BodyType bodyType)
      Parameters:
      body - Template Body
      bodyType - Body Type