Custom email sent by Liferay Form










0















I'm trying to override the email-notification sent out by Liferay Form. I've followed the tricks in this topic: https://community.liferay.com/it/forums/-/message_boards/view_message/104934134.
No dice. I've succesfully added a custom implementation of DDLFormEmailNotificationSender. Which is registered correctly, (with correct service). If I check out the registered service, My custom DDLFormEmailNotificationSender comes out on top. But when I submit a form, liferay keeps using the 'normal' DDLFormEmailNotificationSender, and not my custom DDLFormEmailNotificationSender. Any tips 'n tricks?



My DDLFormEmailNotificationSender looks like this:



@Component(
immediate = true,
property =
"service.ranking:Integer=100"
,
service = DDLFormEmailNotificationSender.class
)
public class CustomDDLFormEmailNotificationSender extends DDLFormEmailNotificationSender

private static final String CUSTOM_TEMPLATE_PATH = "";

@Override
protected Template createTemplate(
PortletRequest portletRequest, DDLRecordSet recordSet,
DDLRecord record) throws PortalException

Template template = TemplateManagerUtil.getTemplate(TemplateConstants.LANG_TYPE_SOY,
getTemplateResource(CUSTOM_TEMPLATE_PATH), false);

populateParameters(template, portletRequest, recordSet, record);

return template;




(I know the CUSTOM_TEMPLATE_PATH is empty right now. But that's only for testing purposes.



I've created a fragment to expose the private package as described in the forum post:



Bundle-Name: liferay-xxx-dynamic-data-lists-form-override
Bundle-SymbolicName: liferay.xxx.dynamic.data.lists.form.override
Fragment-Host: com.liferay.dynamic.data.lists.form.web;bundle-version="2.0.15"

Export-Package: com.liferay.dynamic.data.lists.form.web.internal.notification
-jsp: *.jsp,*.jspf
-plugin.jsp: com.liferay.ant.bnd.jsp.JspAnalyzerPlugin
-plugin.resourcebundle: com.liferay.ant.bnd.resource.bundle.ResourceBundleLoaderAnalyzerPlugin
-plugin.sass: com.liferay.ant.bnd.sass.SassAnalyzerPlugin
-sass: *


So you can see I've exposed the "com.liferay.dynamic.data.lists.form.web.internal.notification" package.



If I check the DDLFormEmailNotificationSender in Apache GOGO:



services | grep DDLFormEmailNotificationSender
com.liferay.dynamic.data.lists.form.web.internal.notification.DDLFormEmailNotificationSender=service.ranking=100, component.name=be.xxx.portal.website.form.CustomDDLFormEmailNotificationSender, component.id=519, service.id=299, service.bundleid=757, service.scope=bundle
com.liferay.dynamic.data.lists.form.web.internal.notification.DDLFormEmailNotificationSender=component.name=com.liferay.dynamic.data.lists.form.web.internal.notification.DDLFormEmailNotificationSender, component.id=811, service.id=2629, service.bundleid=143, service.scope=bundle
true


I'm on Liferay 7.0.










share|improve this question


























    0















    I'm trying to override the email-notification sent out by Liferay Form. I've followed the tricks in this topic: https://community.liferay.com/it/forums/-/message_boards/view_message/104934134.
    No dice. I've succesfully added a custom implementation of DDLFormEmailNotificationSender. Which is registered correctly, (with correct service). If I check out the registered service, My custom DDLFormEmailNotificationSender comes out on top. But when I submit a form, liferay keeps using the 'normal' DDLFormEmailNotificationSender, and not my custom DDLFormEmailNotificationSender. Any tips 'n tricks?



    My DDLFormEmailNotificationSender looks like this:



    @Component(
    immediate = true,
    property =
    "service.ranking:Integer=100"
    ,
    service = DDLFormEmailNotificationSender.class
    )
    public class CustomDDLFormEmailNotificationSender extends DDLFormEmailNotificationSender

    private static final String CUSTOM_TEMPLATE_PATH = "";

    @Override
    protected Template createTemplate(
    PortletRequest portletRequest, DDLRecordSet recordSet,
    DDLRecord record) throws PortalException

    Template template = TemplateManagerUtil.getTemplate(TemplateConstants.LANG_TYPE_SOY,
    getTemplateResource(CUSTOM_TEMPLATE_PATH), false);

    populateParameters(template, portletRequest, recordSet, record);

    return template;




    (I know the CUSTOM_TEMPLATE_PATH is empty right now. But that's only for testing purposes.



    I've created a fragment to expose the private package as described in the forum post:



    Bundle-Name: liferay-xxx-dynamic-data-lists-form-override
    Bundle-SymbolicName: liferay.xxx.dynamic.data.lists.form.override
    Fragment-Host: com.liferay.dynamic.data.lists.form.web;bundle-version="2.0.15"

    Export-Package: com.liferay.dynamic.data.lists.form.web.internal.notification
    -jsp: *.jsp,*.jspf
    -plugin.jsp: com.liferay.ant.bnd.jsp.JspAnalyzerPlugin
    -plugin.resourcebundle: com.liferay.ant.bnd.resource.bundle.ResourceBundleLoaderAnalyzerPlugin
    -plugin.sass: com.liferay.ant.bnd.sass.SassAnalyzerPlugin
    -sass: *


    So you can see I've exposed the "com.liferay.dynamic.data.lists.form.web.internal.notification" package.



    If I check the DDLFormEmailNotificationSender in Apache GOGO:



    services | grep DDLFormEmailNotificationSender
    com.liferay.dynamic.data.lists.form.web.internal.notification.DDLFormEmailNotificationSender=service.ranking=100, component.name=be.xxx.portal.website.form.CustomDDLFormEmailNotificationSender, component.id=519, service.id=299, service.bundleid=757, service.scope=bundle
    com.liferay.dynamic.data.lists.form.web.internal.notification.DDLFormEmailNotificationSender=component.name=com.liferay.dynamic.data.lists.form.web.internal.notification.DDLFormEmailNotificationSender, component.id=811, service.id=2629, service.bundleid=143, service.scope=bundle
    true


    I'm on Liferay 7.0.










    share|improve this question
























      0












      0








      0








      I'm trying to override the email-notification sent out by Liferay Form. I've followed the tricks in this topic: https://community.liferay.com/it/forums/-/message_boards/view_message/104934134.
      No dice. I've succesfully added a custom implementation of DDLFormEmailNotificationSender. Which is registered correctly, (with correct service). If I check out the registered service, My custom DDLFormEmailNotificationSender comes out on top. But when I submit a form, liferay keeps using the 'normal' DDLFormEmailNotificationSender, and not my custom DDLFormEmailNotificationSender. Any tips 'n tricks?



      My DDLFormEmailNotificationSender looks like this:



      @Component(
      immediate = true,
      property =
      "service.ranking:Integer=100"
      ,
      service = DDLFormEmailNotificationSender.class
      )
      public class CustomDDLFormEmailNotificationSender extends DDLFormEmailNotificationSender

      private static final String CUSTOM_TEMPLATE_PATH = "";

      @Override
      protected Template createTemplate(
      PortletRequest portletRequest, DDLRecordSet recordSet,
      DDLRecord record) throws PortalException

      Template template = TemplateManagerUtil.getTemplate(TemplateConstants.LANG_TYPE_SOY,
      getTemplateResource(CUSTOM_TEMPLATE_PATH), false);

      populateParameters(template, portletRequest, recordSet, record);

      return template;




      (I know the CUSTOM_TEMPLATE_PATH is empty right now. But that's only for testing purposes.



      I've created a fragment to expose the private package as described in the forum post:



      Bundle-Name: liferay-xxx-dynamic-data-lists-form-override
      Bundle-SymbolicName: liferay.xxx.dynamic.data.lists.form.override
      Fragment-Host: com.liferay.dynamic.data.lists.form.web;bundle-version="2.0.15"

      Export-Package: com.liferay.dynamic.data.lists.form.web.internal.notification
      -jsp: *.jsp,*.jspf
      -plugin.jsp: com.liferay.ant.bnd.jsp.JspAnalyzerPlugin
      -plugin.resourcebundle: com.liferay.ant.bnd.resource.bundle.ResourceBundleLoaderAnalyzerPlugin
      -plugin.sass: com.liferay.ant.bnd.sass.SassAnalyzerPlugin
      -sass: *


      So you can see I've exposed the "com.liferay.dynamic.data.lists.form.web.internal.notification" package.



      If I check the DDLFormEmailNotificationSender in Apache GOGO:



      services | grep DDLFormEmailNotificationSender
      com.liferay.dynamic.data.lists.form.web.internal.notification.DDLFormEmailNotificationSender=service.ranking=100, component.name=be.xxx.portal.website.form.CustomDDLFormEmailNotificationSender, component.id=519, service.id=299, service.bundleid=757, service.scope=bundle
      com.liferay.dynamic.data.lists.form.web.internal.notification.DDLFormEmailNotificationSender=component.name=com.liferay.dynamic.data.lists.form.web.internal.notification.DDLFormEmailNotificationSender, component.id=811, service.id=2629, service.bundleid=143, service.scope=bundle
      true


      I'm on Liferay 7.0.










      share|improve this question














      I'm trying to override the email-notification sent out by Liferay Form. I've followed the tricks in this topic: https://community.liferay.com/it/forums/-/message_boards/view_message/104934134.
      No dice. I've succesfully added a custom implementation of DDLFormEmailNotificationSender. Which is registered correctly, (with correct service). If I check out the registered service, My custom DDLFormEmailNotificationSender comes out on top. But when I submit a form, liferay keeps using the 'normal' DDLFormEmailNotificationSender, and not my custom DDLFormEmailNotificationSender. Any tips 'n tricks?



      My DDLFormEmailNotificationSender looks like this:



      @Component(
      immediate = true,
      property =
      "service.ranking:Integer=100"
      ,
      service = DDLFormEmailNotificationSender.class
      )
      public class CustomDDLFormEmailNotificationSender extends DDLFormEmailNotificationSender

      private static final String CUSTOM_TEMPLATE_PATH = "";

      @Override
      protected Template createTemplate(
      PortletRequest portletRequest, DDLRecordSet recordSet,
      DDLRecord record) throws PortalException

      Template template = TemplateManagerUtil.getTemplate(TemplateConstants.LANG_TYPE_SOY,
      getTemplateResource(CUSTOM_TEMPLATE_PATH), false);

      populateParameters(template, portletRequest, recordSet, record);

      return template;




      (I know the CUSTOM_TEMPLATE_PATH is empty right now. But that's only for testing purposes.



      I've created a fragment to expose the private package as described in the forum post:



      Bundle-Name: liferay-xxx-dynamic-data-lists-form-override
      Bundle-SymbolicName: liferay.xxx.dynamic.data.lists.form.override
      Fragment-Host: com.liferay.dynamic.data.lists.form.web;bundle-version="2.0.15"

      Export-Package: com.liferay.dynamic.data.lists.form.web.internal.notification
      -jsp: *.jsp,*.jspf
      -plugin.jsp: com.liferay.ant.bnd.jsp.JspAnalyzerPlugin
      -plugin.resourcebundle: com.liferay.ant.bnd.resource.bundle.ResourceBundleLoaderAnalyzerPlugin
      -plugin.sass: com.liferay.ant.bnd.sass.SassAnalyzerPlugin
      -sass: *


      So you can see I've exposed the "com.liferay.dynamic.data.lists.form.web.internal.notification" package.



      If I check the DDLFormEmailNotificationSender in Apache GOGO:



      services | grep DDLFormEmailNotificationSender
      com.liferay.dynamic.data.lists.form.web.internal.notification.DDLFormEmailNotificationSender=service.ranking=100, component.name=be.xxx.portal.website.form.CustomDDLFormEmailNotificationSender, component.id=519, service.id=299, service.bundleid=757, service.scope=bundle
      com.liferay.dynamic.data.lists.form.web.internal.notification.DDLFormEmailNotificationSender=component.name=com.liferay.dynamic.data.lists.form.web.internal.notification.DDLFormEmailNotificationSender, component.id=811, service.id=2629, service.bundleid=143, service.scope=bundle
      true


      I'm on Liferay 7.0.







      liferay liferay-7






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Nov 12 '18 at 8:01









      Kornelito BenitoKornelito Benito

      59011126




      59011126






















          1 Answer
          1






          active

          oldest

          votes


















          0














          I've got some support from the Liferay Community, and found out how to fix it.



          Above configuration is correct! But, the (liferay)service referencing the DDLFormEmailNotification, has this reference static / reluctant. I had to create a config file to drop in my osgi/configs folder, which defines the correct implementation. (My CustomDDLFormEmailNotificationSender).



          My config file is named: com.liferay.dynamic.data.lists.form.web.internal.portlet.action.AddRecordMVCActionCommand.config



          This is because I need to configure the AddRecordMVCAction command. (Configure references that are defined there as static / reluctant).



          It contains:



          DDLFormEmailNotificationSender.target="(component.name=be.xxx.portal.website.form.CustomDDLFormEmailNotificationSender)"


          So basicly it says: DDLFormEmailNotificationSender (is the reference name there), should be: be.xxx.portal.website.form.CustomDDLFormEmailNotificationSender.



          Make sure that component is deployed correctly, because once configured, there is no fallback to the original implementation. (If you remove that configuration, osgi will fallback).



          Source: https://dev.liferay.com/en/develop/tutorials/-/knowledge_base/7-0/overriding-service-references#find-the-component-and-service-reference



          Hope this helps someone.






          share|improve this answer
























            Your Answer






            StackExchange.ifUsing("editor", function ()
            StackExchange.using("externalEditor", function ()
            StackExchange.using("snippets", function ()
            StackExchange.snippets.init();
            );
            );
            , "code-snippets");

            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "1"
            ;
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function()
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled)
            StackExchange.using("snippets", function()
            createEditor();
            );

            else
            createEditor();

            );

            function createEditor()
            StackExchange.prepareEditor(
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader:
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            ,
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );













            draft saved

            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53257951%2fcustom-email-sent-by-liferay-form%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            0














            I've got some support from the Liferay Community, and found out how to fix it.



            Above configuration is correct! But, the (liferay)service referencing the DDLFormEmailNotification, has this reference static / reluctant. I had to create a config file to drop in my osgi/configs folder, which defines the correct implementation. (My CustomDDLFormEmailNotificationSender).



            My config file is named: com.liferay.dynamic.data.lists.form.web.internal.portlet.action.AddRecordMVCActionCommand.config



            This is because I need to configure the AddRecordMVCAction command. (Configure references that are defined there as static / reluctant).



            It contains:



            DDLFormEmailNotificationSender.target="(component.name=be.xxx.portal.website.form.CustomDDLFormEmailNotificationSender)"


            So basicly it says: DDLFormEmailNotificationSender (is the reference name there), should be: be.xxx.portal.website.form.CustomDDLFormEmailNotificationSender.



            Make sure that component is deployed correctly, because once configured, there is no fallback to the original implementation. (If you remove that configuration, osgi will fallback).



            Source: https://dev.liferay.com/en/develop/tutorials/-/knowledge_base/7-0/overriding-service-references#find-the-component-and-service-reference



            Hope this helps someone.






            share|improve this answer





























              0














              I've got some support from the Liferay Community, and found out how to fix it.



              Above configuration is correct! But, the (liferay)service referencing the DDLFormEmailNotification, has this reference static / reluctant. I had to create a config file to drop in my osgi/configs folder, which defines the correct implementation. (My CustomDDLFormEmailNotificationSender).



              My config file is named: com.liferay.dynamic.data.lists.form.web.internal.portlet.action.AddRecordMVCActionCommand.config



              This is because I need to configure the AddRecordMVCAction command. (Configure references that are defined there as static / reluctant).



              It contains:



              DDLFormEmailNotificationSender.target="(component.name=be.xxx.portal.website.form.CustomDDLFormEmailNotificationSender)"


              So basicly it says: DDLFormEmailNotificationSender (is the reference name there), should be: be.xxx.portal.website.form.CustomDDLFormEmailNotificationSender.



              Make sure that component is deployed correctly, because once configured, there is no fallback to the original implementation. (If you remove that configuration, osgi will fallback).



              Source: https://dev.liferay.com/en/develop/tutorials/-/knowledge_base/7-0/overriding-service-references#find-the-component-and-service-reference



              Hope this helps someone.






              share|improve this answer



























                0












                0








                0







                I've got some support from the Liferay Community, and found out how to fix it.



                Above configuration is correct! But, the (liferay)service referencing the DDLFormEmailNotification, has this reference static / reluctant. I had to create a config file to drop in my osgi/configs folder, which defines the correct implementation. (My CustomDDLFormEmailNotificationSender).



                My config file is named: com.liferay.dynamic.data.lists.form.web.internal.portlet.action.AddRecordMVCActionCommand.config



                This is because I need to configure the AddRecordMVCAction command. (Configure references that are defined there as static / reluctant).



                It contains:



                DDLFormEmailNotificationSender.target="(component.name=be.xxx.portal.website.form.CustomDDLFormEmailNotificationSender)"


                So basicly it says: DDLFormEmailNotificationSender (is the reference name there), should be: be.xxx.portal.website.form.CustomDDLFormEmailNotificationSender.



                Make sure that component is deployed correctly, because once configured, there is no fallback to the original implementation. (If you remove that configuration, osgi will fallback).



                Source: https://dev.liferay.com/en/develop/tutorials/-/knowledge_base/7-0/overriding-service-references#find-the-component-and-service-reference



                Hope this helps someone.






                share|improve this answer















                I've got some support from the Liferay Community, and found out how to fix it.



                Above configuration is correct! But, the (liferay)service referencing the DDLFormEmailNotification, has this reference static / reluctant. I had to create a config file to drop in my osgi/configs folder, which defines the correct implementation. (My CustomDDLFormEmailNotificationSender).



                My config file is named: com.liferay.dynamic.data.lists.form.web.internal.portlet.action.AddRecordMVCActionCommand.config



                This is because I need to configure the AddRecordMVCAction command. (Configure references that are defined there as static / reluctant).



                It contains:



                DDLFormEmailNotificationSender.target="(component.name=be.xxx.portal.website.form.CustomDDLFormEmailNotificationSender)"


                So basicly it says: DDLFormEmailNotificationSender (is the reference name there), should be: be.xxx.portal.website.form.CustomDDLFormEmailNotificationSender.



                Make sure that component is deployed correctly, because once configured, there is no fallback to the original implementation. (If you remove that configuration, osgi will fallback).



                Source: https://dev.liferay.com/en/develop/tutorials/-/knowledge_base/7-0/overriding-service-references#find-the-component-and-service-reference



                Hope this helps someone.







                share|improve this answer














                share|improve this answer



                share|improve this answer








                edited Nov 16 '18 at 13:16

























                answered Nov 13 '18 at 9:23









                Kornelito BenitoKornelito Benito

                59011126




                59011126





























                    draft saved

                    draft discarded
















































                    Thanks for contributing an answer to Stack Overflow!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid


                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.

                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53257951%2fcustom-email-sent-by-liferay-form%23new-answer', 'question_page');

                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    𛂒𛀶,𛀽𛀑𛂀𛃧𛂓𛀙𛃆𛃑𛃷𛂟𛁡𛀢𛀟𛁤𛂽𛁕𛁪𛂟𛂯,𛁞𛂧𛀴𛁄𛁠𛁼𛂿𛀤 𛂘,𛁺𛂾𛃭𛃭𛃵𛀺,𛂣𛃍𛂖𛃶 𛀸𛃀𛂖𛁶𛁏𛁚 𛂢𛂞 𛁰𛂆𛀔,𛁸𛀽𛁓𛃋𛂇𛃧𛀧𛃣𛂐𛃇,𛂂𛃻𛃲𛁬𛃞𛀧𛃃𛀅 𛂭𛁠𛁡𛃇𛀷𛃓𛁥,𛁙𛁘𛁞𛃸𛁸𛃣𛁜,𛂛,𛃿,𛁯𛂘𛂌𛃛𛁱𛃌𛂈𛂇 𛁊𛃲,𛀕𛃴𛀜 𛀶𛂆𛀶𛃟𛂉𛀣,𛂐𛁞𛁾 𛁷𛂑𛁳𛂯𛀬𛃅,𛃶𛁼

                    Edmonton

                    Crossroads (UK TV series)