ozimov/spring-boot-email-tools

spring-boot-pebble-email for non-web Spring boot

lxnx0 opened this issue ยท 7 comments

lxnx0 commented

Hi guys,

Sorry if I'm asking this question in the wrong place.
Is there any way to use this library with template engine without web environment enabled.

Disabling the web #spring.main.web-environment=false will keep on getting the following

Field pebbleViewResolver in it.ozimov.springboot.mail.templating.service.PebbleTemplateService required a bean of type 'com.mitchellbosecke.pebble.spring4.PebbleViewResolver' that could not be found.
    - Bean method 'pebbleViewResolver' not loaded because @ConditionalOnWebApplication (required) not a web application


Action:

Consider revisiting the conditions above or defining a bean of type 'com.mitchellbosecke.pebble.spring4.PebbleViewResolver' in your configuration.

Hi
This is not the wrong place.

Let me understand, which dependencies are you using from this library?

lxnx0 commented

Hi @robertotru,

Thank you for the response. Following is the dependency used.

<dependency>
    <groupId>it.ozimov</groupId>
    <artifactId>spring-boot-pebble-email</artifactId>
    <version>0.5.1</version>
</dependency>

@lxnx0 this seems to be a problem with Pebble. I tried with Mustache and that option is not an issue. Can you try as well?

lxnx0 commented

@robertotru, I just tested with Mustache. No issue.

@lxnx0 I've got the confirmation from the Pebble guys that the the pebble-spring-boot-starter expects a web environment. Therefore I'll fix this issue since not resolvable by us.

Thanks for reporting it.

@lxnx0 The new release of Pebble template for Spring fixes the issue. Do you still need a working artifact? Otherwise I will release later on.

lxnx0 commented

I'm using Mustache at the moment. Should be fine to release it later on.