Closed gbourant closed 11 months ago
Ah. Well, it's true that an NPE is not good. I could start it with the default locale. But I also think that mails won't use the request locale if it's overridden, because there's no hook yet. I have to fix this.
I've filed https://github.com/quarkusio/quarkus/issues/36749 for the Qute side to add an SPI. I'll fix the NPE for now, but it won't allow you to use the locale cookie or even request headers from emails without explicitely setting the locale on MailTemplateInstance
.
I'm testing the following service which sends Qute emails with i18n messages.
The email template is using i18n messages but i get the error
java.lang.NullPointerException: Cannot invoke "java.util.Locale.getLanguage()" because "this.locale" is null
.This is caused because the locale is set by
Filters.filterRequest(ResteasyReactiveContainerRequestContext requestContext, HttpServerRequest req)
which in it's turn callsi18n.readLanguageCookie()
and in my case i do not make any http request, i'm testing directly theAuthService
.