This is an automated email from the ASF dual-hosted git repository.

nmalin pushed a commit to branch release24.09
in repository https://gitbox.apache.org/repos/asf/ofbiz-framework.git


The following commit(s) were added to refs/heads/release24.09 by this push:
     new 1f9b180dc6 Fixed: Restore service sendNotification
1f9b180dc6 is described below

commit 1f9b180dc66490b0abe8f80b740a6452190a9511
Author: Nicolas Malin <nicolas.ma...@nereide.fr>
AuthorDate: Tue Oct 15 10:33:24 2024 +0200

    Fixed: Restore service sendNotification
    
    The service function had been moved to private, that break the service 
engine invocation. Restore it to public and synchronise the freemarker template 
creation with adding delegator and dispatcher to fix the url rendering system 
that need delegator
---
 .../main/java/org/apache/ofbiz/common/email/NotificationServices.java | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git 
a/framework/common/src/main/java/org/apache/ofbiz/common/email/NotificationServices.java
 
b/framework/common/src/main/java/org/apache/ofbiz/common/email/NotificationServices.java
index cd749a2dda..da3ac174ac 100644
--- 
a/framework/common/src/main/java/org/apache/ofbiz/common/email/NotificationServices.java
+++ 
b/framework/common/src/main/java/org/apache/ofbiz/common/email/NotificationServices.java
@@ -118,7 +118,7 @@ public class NotificationServices {
      * the sevice
      * @return A Map with the service response messages in it
      */
-    private static Map<String, Object> sendNotification(DispatchContext ctx, 
Map<String, ? extends Object> context) {
+    public static Map<String, Object> sendNotification(DispatchContext ctx, 
Map<String, ? extends Object> context) {
         LocalDispatcher dispatcher = ctx.getDispatcher();
         Locale locale = (Locale) context.get("locale");
         Map<String, Object> result = null;
@@ -193,6 +193,8 @@ public class NotificationServices {
         if (templateData == null) {
             templateData = new LinkedHashMap<>();
         }
+        templateData.put("delegator", delegator);
+        templateData.put("dispatcher", ctx.getDispatcher());
 
         try {
             // ensure the baseURl is defined

Reply via email to