Page 1 of 1
Send Email from admin backoffice
Posted: Thu Jun 20, 2013 8:45 am
by renob
We would like to be able to send email from the admin (BO) , with an thymeleaf email template and our custom dialect, like you have on front web site.
Do you have any easy way to send email from the admin ?
Best regard
Renaud
Re: Send Email from admin backoffice
Posted: Thu Jun 20, 2013 9:00 am
by phillipuniverse
What version of Broadleaf are you on?
Re: Send Email from admin backoffice
Posted: Thu Jun 20, 2013 10:10 am
by renob
We are working on Version 2.21 Snapshot
We want to used the same template as we used on front (same ressources), It is possible to put it inside broadleaf core ?
Re: Send Email from admin backoffice
Posted: Thu Jun 20, 2013 11:30 am
by phillipuniverse
Yes, in that case I would move all of your email resources into your core project so that you can pick up those bean references from the admin.
Re: Send Email from admin backoffice
Posted: Thu Jun 20, 2013 11:50 am
by renob
Ok thank you for your answer,
But what about the custom processors as blc:price ? Are they usable if we send email from the admin, or it's gonna be a issue ?
Can we add our custom dialect as we did in front web site?
Thank
Re: Send Email from admin backoffice
Posted: Thu Jun 20, 2013 12:24 pm
by jfridye
Yes, if Thymeleaf is your template engine, you will be able to use custom processors, such as blc:price, in email templates.
Re: Send Email from admin backoffice
Posted: Fri Jun 21, 2013 6:56 am
by renob
I tried and the broadleaf custom processor (blc:price) not working in email template send from the Admin because they are in org.broadleafcommerce.core.web.processor, this package is no in the admin so I got this stack trace :
Code: Select all
org.springframework.mail.MailPreparationException: Could not prepare mail; nested exception is org.thymeleaf.exceptions.TemplateProcessingException: Error during execution of processor 'org.broadleafcommerce.core.web.processor.PriceTextDisplayProcessor' (certificatIntemperies-email:38)
at org.springframework.mail.javamail.JavaMailSenderImpl.send(JavaMailSenderImpl.java:367)
at org.springframework.mail.javamail.JavaMailSenderImpl.send(JavaMailSenderImpl.java:344)
at org.broadleafcommerce.common.email.service.message.MessageCreator.sendMessage(MessageCreator.java:41)
at org.broadleafcommerce.common.email.service.EmailServiceImpl.sendBasicEmail(EmailServiceImpl.java:96)
at org.broadleafcommerce.common.email.service.EmailServiceImpl.sendTemplateEmail(EmailServiceImpl.java:66)
at org.broadleafcommerce.common.email.service.EmailServiceImpl.sendTemplateEmail(EmailServiceImpl.java:73)
at fr.meteo.ecommerce.common.email.service.MFEmailServiceImpl.sendTemplateEmail(MFEmailServiceImpl.java:134)
at fr.meteo.ecommerce.core.product.certificat.CertificatIntemperiesServiceImpl.produce(CertificatIntemperiesServiceImpl.java:42)
at fr.meteo.ecommerce.core.subscription.service.SubscriptionGenerationServiceImpl.generateFinalSubscription(SubscriptionGenerationServiceImpl.java:245)
at fr.meteo.ecommerce.core.produce.service.workflow.ProduceVirtualProductActivity.execute(ProduceVirtualProductActivity.java:79)
at org.broadleafcommerce.core.workflow.SequenceProcessor.doActivities(SequenceProcessor.java:62)
at fr.meteo.ecommerce.core.produce.service.ProduceOrderServiceImpl.executeProduceOrder(ProduceOrderServiceImpl.java:37)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:319)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
at $Proxy135.executeProduceOrder(Unknown Source)
at fr.meteo.ecommerce.core.checkout.service.workflow.ProduceOrderActivity.execute(ProduceOrderActivity.java:38)
at org.broadleafcommerce.core.workflow.SequenceProcessor.doActivities(SequenceProcessor.java:62)
at org.broadleafcommerce.core.checkout.service.CheckoutServiceImpl.performCheckout(CheckoutServiceImpl.java:73)
at fr.meteo.ecommerce.admin.controller.subscription.AddSubscriptionBOController.addSubscriptionToCart(AddSubscriptionBOController.java:206)
at fr.meteo.ecommerce.admin.controller.subscription.AddSubscriptionBOController.addconfiguredProductToCart(AddSubscriptionBOController.java:134)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.springframework.web.method.support.InvocableHandlerMethod.invoke(InvocableHandlerMethod.java:219)
at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:132)
at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:100)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:604)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:565)
at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:80)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:923)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:852)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:882)
at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:789)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)
at org.broadleafcommerce.openadmin.security.AdminSandBoxFilter.doFilterInternal(AdminSandBoxFilter.java:70)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.broadleafcommerce.common.web.util.PrecompressedArtifactFilter.doFilter(PrecompressedArtifactFilter.java:85)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:77)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:192)
at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:166)
at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346)
at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:259)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)
at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:108)
at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:84)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:118)
at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:84)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:113)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:103)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:113)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:54)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:45)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.authentication.ui.DefaultLoginPageGeneratingFilter.doFilter(DefaultLoginPageGeneratingFilter.java:91)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:183)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:105)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:87)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.access.channel.ChannelProcessingFilter.doFilter(ChannelProcessingFilter.java:144)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:192)
at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:166)
at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346)
at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:259)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)
at org.springframework.orm.jpa.support.OpenEntityManagerInViewFilter.doFilterInternal(OpenEntityManagerInViewFilter.java:147)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:192)
at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:160)
at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346)
at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:259)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:602)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
at java.lang.Thread.run(Unknown Source)
Caused by: org.thymeleaf.exceptions.TemplateProcessingException: Error during execution of processor 'org.broadleafcommerce.core.web.processor.PriceTextDisplayProcessor' (certificatIntemperies-email:38)
at org.thymeleaf.processor.AbstractProcessor.process(AbstractProcessor.java:223)
at org.thymeleaf.dom.Node.applyNextProcessor(Node.java:896)
at org.thymeleaf.dom.Node.processNode(Node.java:858)
at org.thymeleaf.dom.NestableNode.computeNextChild(NestableNode.java:639)
at org.thymeleaf.dom.NestableNode.doAdditionalProcess(NestableNode.java:621)
at org.thymeleaf.dom.Node.processNode(Node.java:876)
at org.thymeleaf.dom.NestableNode.computeNextChild(NestableNode.java:639)
at org.thymeleaf.dom.NestableNode.doAdditionalProcess(NestableNode.java:621)
at org.thymeleaf.dom.Node.processNode(Node.java:876)
at org.thymeleaf.dom.NestableNode.computeNextChild(NestableNode.java:639)
at org.thymeleaf.dom.NestableNode.doAdditionalProcess(NestableNode.java:621)
at org.thymeleaf.dom.Node.processNode(Node.java:876)
at org.thymeleaf.dom.NestableNode.computeNextChild(NestableNode.java:639)
at org.thymeleaf.dom.NestableNode.doAdditionalProcess(NestableNode.java:621)
at org.thymeleaf.dom.Node.processNode(Node.java:876)
at org.thymeleaf.dom.Document.process(Document.java:93)
at org.thymeleaf.TemplateEngine.process(TemplateEngine.java:1261)
at org.thymeleaf.TemplateEngine.process(TemplateEngine.java:1157)
at org.thymeleaf.TemplateEngine.process(TemplateEngine.java:1103)
at org.thymeleaf.TemplateEngine.process(TemplateEngine.java:1016)
at org.thymeleaf.TemplateEngine.process(TemplateEngine.java:990)
at org.broadleafcommerce.common.email.service.message.ThymeleafMessageCreator.buildMessageBody(ThymeleafMessageCreator.java:54)
at org.broadleafcommerce.common.email.service.message.MessageCreator$1.prepare(MessageCreator.java:63)
at org.springframework.mail.javamail.JavaMailSenderImpl.send(JavaMailSenderImpl.java:352)
... 113 more
Caused by: java.lang.NullPointerException
at org.broadleafcommerce.core.web.processor.PriceTextDisplayProcessor.getText(PriceTextDisplayProcessor.java:68)
at org.thymeleaf.processor.attr.AbstractTextChildModifierAttrProcessor.getModifiedChildren(AbstractTextChildModifierAttrProcessor.java:59)
at org.thymeleaf.processor.attr.AbstractChildrenModifierAttrProcessor.processAttribute(AbstractChildrenModifierAttrProcessor.java:58)
at org.thymeleaf.processor.attr.AbstractAttrProcessor.doProcess(AbstractAttrProcessor.java:74)
at org.thymeleaf.processor.AbstractProcessor.process(AbstractProcessor.java:212)
... 136 more
I guess this package is in
Broadleaf-framework-webIf I add this module to the admin in order to have custom processor from broadleaf for my email, this could may be add news issues ?, or it will work fine ?
Code: Select all
<dependency>
<groupId>org.broadleafcommerce</groupId>
<artifactId>broadleaf-framework-web</artifactId>
</dependency>
Thank