<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <title>RE: LR7 Custom email notification in Web Form portlet</title>
  <link rel="self" href="https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=104934135" />
  <subtitle>RE: LR7 Custom email notification in Web Form portlet</subtitle>
  <id>https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=104934135</id>
  <updated>2026-04-05T11:41:08Z</updated>
  <dc:date>2026-04-05T11:41:08Z</dc:date>
  <entry>
    <title>RE: LR7 Custom email notification in Web Form portlet</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=119633930" />
    <author>
      <name>mehdi tilab</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=119633930</id>
    <updated>2020-07-23T06:30:56Z</updated>
    <published>2020-07-23T06:30:56Z</published>
    <summary type="html">Hi &lt;strong&gt;Shubhankit &lt;/strong&gt;,&lt;br /&gt;Can you share your code?</summary>
    <dc:creator>mehdi tilab</dc:creator>
    <dc:date>2020-07-23T06:30:56Z</dc:date>
  </entry>
  <entry>
    <title>RE: LR7 Custom email notification in Web Form portlet</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=119155470" />
    <author>
      <name>Shubhankit Roy</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=119155470</id>
    <updated>2020-05-14T11:43:12Z</updated>
    <published>2020-05-14T11:43:12Z</published>
    <summary type="html">&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;Yes, we have implemeneted this functionality both in DXP 7.0 and DXP 7.2&lt;br&gt;In 7.2, this is what we did to achieve it:&lt;br&gt;1. Created a bundle to add a custom 'email template' field in the form settings. For this, we override the &lt;pre&gt;&lt;code&gt;DDMFormInstanceSettings.java&lt;/code&gt;&lt;/pre&gt; interface and added our custom form setting. This was done to make the template text configurable on per form basis. If this is not your requirement, and you just want to always use a fixed custom email template, then creating this module can be skipped altogether. Note that this module needs to go to /osgi/marketplace/override folder as we are making changes to what is provided by its related lpkg file. Check &lt;a href="https://portal.liferay.dev/docs/7-2/customization/-/knowledge_base/c/overriding-lpkg-files"&gt;https://portal.liferay.dev/docs/7-2/customization/-/knowledge_base/c/overriding-lpkg-files&lt;/a&gt;&lt;br&gt;2. Secondly, we created a hook to create override Liferay's &lt;pre&gt;&lt;code&gt;DDMFormEmailNotificationSender.java&lt;/code&gt;&lt;/pre&gt; with our own custom class  and registered it with a higher service ranking. Within this module we also kept a reference to the form_entry_add_body.soy template but didn't make any changes to it because we created our own form setting for custom email template per form. So we wrote our own soy file to fetch the email template from form setting (if its configured) and added it the soy file on-the-fly. Again, if you want a fixed custom template always, you don't need to create this extra soy file, and just modify the &lt;pre&gt;&lt;code&gt;form_entry_add_body.soy&lt;/code&gt;&lt;/pre&gt;as per your need.&lt;br&gt;&lt;br&gt;3. Finally, but most importantly, the&lt;br&gt;&lt;pre&gt;&lt;code&gt;DDMFormEmailNotificationSender.java&lt;/code&gt;&lt;/pre&gt; resides in a private package: &lt;pre&gt;&lt;code&gt;com.liferay.dynamic.data.mapping.internal.notification&lt;/code&gt;&lt;/pre&gt; , therefore to be able to override it with our custom implementation, we needed it be exposed/available to be overridden. To achieve this, we simply created a fragment module to export that package via bnd :&lt;br&gt;&lt;pre&gt;&lt;code&gt;Export-Package: com.liferay.dynamic.data.mapping.internal.notification&lt;/code&gt;&lt;/pre&gt;And that's it! &lt;br&gt;Hope you'll be able to achieve this in a similar way in 7.2/7.0 keeping in mind the names of the related classes and the packages in which they reside.&lt;/body&gt;&lt;/html&gt;</summary>
    <dc:creator>Shubhankit Roy</dc:creator>
    <dc:date>2020-05-14T11:43:12Z</dc:date>
  </entry>
  <entry>
    <title>RE: LR7 Custom email notification in Web Form portlet</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=114548833" />
    <author>
      <name>Eric DARIEL</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=114548833</id>
    <updated>2025-10-21T05:12:37Z</updated>
    <published>2019-07-31T18:33:28Z</published>
    <summary type="html">Has anyone successfully written these bundles to enable us to overwrite the default soy template for Forms application?</summary>
    <dc:creator>Eric DARIEL</dc:creator>
    <dc:date>2019-07-31T18:33:28Z</dc:date>
  </entry>
  <entry>
    <title>RE: LR7 Custom email notification in Web Form portlet</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=111022086" />
    <author>
      <name>David Weitzel</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=111022086</id>
    <updated>2018-09-24T15:26:02Z</updated>
    <published>2018-09-24T15:26:02Z</published>
    <summary type="html">&lt;p&gt;Has anyone successfully written these bundles to enable us to
  overwrite the default soy template for Forms application?&lt;/p&gt;
&lt;p&gt;We are struggling and it would be nice if there was a version we
  could adopt.&lt;/p&gt;
&lt;p&gt;I am amazed this still isn't in the core product capability, my
  content administrators are waiting on development to enable changing
  the styles in the email...&lt;/p&gt;
&lt;p&gt;We have the build working but not getting deployed now on DXP 7.0&lt;/p&gt;</summary>
    <dc:creator>David Weitzel</dc:creator>
    <dc:date>2018-09-24T15:26:02Z</dc:date>
  </entry>
  <entry>
    <title>RE: LR7 Custom email notification in Web Form portlet</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=110585250" />
    <author>
      <name>Harish Kumar</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=110585250</id>
    <updated>2018-07-18T07:51:55Z</updated>
    <published>2018-07-18T07:51:55Z</published>
    <summary type="html">&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;&lt;blockquote&gt;
  &lt;div class="quote-title"&gt;Dipti Ranparia:&lt;/div&gt;
  &lt;div class="quote"&gt;
    &lt;div class="quote-content"&gt;
      &lt;blockquote&gt;
        &lt;div class="quote-title"&gt;Milind Jain:&lt;/div&gt;
        &lt;div class="quote"&gt;
          &lt;div class="quote-content"&gt;Hello, I am also facing same. Have
            you resolved. Please share. Thanks in advance.&lt;/div&gt;&lt;/div&gt;&lt;/blockquote&gt;
      &lt;p&gt;&amp;nbsp;&lt;/p&gt;
      &lt;p&gt;&amp;nbsp;&lt;/p&gt;
      &lt;p&gt;No I could not solve this way..&lt;/p&gt;
      &lt;p&gt;&amp;nbsp;&lt;/p&gt;
      &lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/blockquote&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Hi Dipti,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;We implemented the same customization - adding file upload capability
  to web form and sending the same in email as attachment.&lt;/p&gt;
&lt;p&gt;We did follow the official documentation to achieve this -&amp;nbsp;https://dev.liferay.com/es/develop/tutorials/-/knowledge_base/7-0/creating-form-field-types&lt;/p&gt;
&lt;p&gt;Did you already tried the steps mentioned in the official documentation?&lt;/p&gt;
&lt;p&gt;Following are the steps -&amp;nbsp;&lt;/p&gt;
&lt;p&gt;1. Implement DDMFORMFIELDTYPE Component to create new field type&lt;/p&gt;
&lt;p&gt;2. Create Fragment for&amp;nbsp;com.liferay.dynamic.data.lists.form.web to
  update view.jsp to add&amp;nbsp;enctype="multipart/form-data"
  capability to form&lt;/p&gt;
&lt;p&gt;3. Overriding Action Command to provide your own customization - (&lt;a href="https://dev.liferay.com/es/develop/tutorials/-/knowledge_base/7-0/overriding-mvc-commands)"&gt;https://dev.liferay.com/es/develop/tutorials/-/knowledge_base/7-0/overriding-mvc-commands)&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;
  &lt;code&gt;@Component(immediate = true, property =
    {"javax.portlet.name=" +
    DDLFormPortletKeys.DYNAMIC_DATA_LISTS_FORM,&amp;lt;br&amp;gt; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp;
    &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp;"mvc.command.name=addRecord",&amp;lt;br&amp;gt;
    &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp;
    &amp;amp;nbsp;"service.ranking:Integer=100"}, service = MVCActionCommand.class)&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Hope this helps!!&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;Harish&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</summary>
    <dc:creator>Harish Kumar</dc:creator>
    <dc:date>2018-07-18T07:51:55Z</dc:date>
  </entry>
  <entry>
    <title>RE: LR7 Custom email notification in Web Form portlet</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=110576762" />
    <author>
      <name>Dipti Ranparia</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=110576762</id>
    <updated>2018-07-17T06:52:39Z</updated>
    <published>2018-07-17T06:52:39Z</published>
    <summary type="html">&lt;blockquote&gt;
  &lt;div class="quote-title"&gt;Milind Jain:&lt;/div&gt;
  &lt;div class="quote"&gt;
    &lt;div class="quote-content"&gt;Hello, I am also facing same. Have you
      resolved. Please share. Thanks in advance.&lt;/div&gt;&lt;/div&gt;&lt;/blockquote&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;No I could not solve this way..&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt; &lt;/p&gt;</summary>
    <dc:creator>Dipti Ranparia</dc:creator>
    <dc:date>2018-07-17T06:52:39Z</dc:date>
  </entry>
  <entry>
    <title>RE: LR7 Custom email notification in Web Form portlet</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=107722315" />
    <author>
      <name>Milind Jain</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=107722315</id>
    <updated>2018-05-03T13:21:31Z</updated>
    <published>2018-05-03T13:21:31Z</published>
    <summary type="html">Hello,&lt;br /&gt;&lt;br /&gt;I am also facing same. Have you resolved.&lt;br /&gt;Please share. Thanks in advance.</summary>
    <dc:creator>Milind Jain</dc:creator>
    <dc:date>2018-05-03T13:21:31Z</dc:date>
  </entry>
  <entry>
    <title>RE: LR7 Custom email notification in Web Form portlet</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=107611501" />
    <author>
      <name>David H Nebinger</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=107611501</id>
    <updated>2018-05-01T13:24:13Z</updated>
    <published>2018-05-01T13:24:13Z</published>
    <summary type="html">Drop into gogo and do a diag on your bundle.&lt;br /&gt;&lt;br /&gt;Also try the scr:list and verify that all services are active.</summary>
    <dc:creator>David H Nebinger</dc:creator>
    <dc:date>2018-05-01T13:24:13Z</dc:date>
  </entry>
  <entry>
    <title>RE: LR7 Custom email notification in Web Form portlet</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=107597822" />
    <author>
      <name>Dipti Ranparia</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=107597822</id>
    <updated>2018-05-01T06:07:43Z</updated>
    <published>2018-05-01T06:07:43Z</published>
    <summary type="html">&lt;div class="quote-title"&gt;David H Nebinger:&lt;/div&gt;&lt;blockquote&gt;Do you know if it is executing both, or just the old one?&lt;/blockquote&gt;&lt;br /&gt;Just older one is being executing.</summary>
    <dc:creator>Dipti Ranparia</dc:creator>
    <dc:date>2018-05-01T06:07:43Z</dc:date>
  </entry>
  <entry>
    <title>RE: LR7 Custom email notification in Web Form portlet</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=107590366" />
    <author>
      <name>David H Nebinger</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=107590366</id>
    <updated>2018-04-30T21:20:25Z</updated>
    <published>2018-04-30T21:20:25Z</published>
    <summary type="html">Do you know if it is executing both, or just the old one?</summary>
    <dc:creator>David H Nebinger</dc:creator>
    <dc:date>2018-04-30T21:20:25Z</dc:date>
  </entry>
  <entry>
    <title>RE: LR7 Custom email notification in Web Form portlet</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=107572423" />
    <author>
      <name>Dipti Ranparia</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=107572423</id>
    <updated>2018-04-30T15:39:28Z</updated>
    <published>2018-04-30T15:39:28Z</published>
    <summary type="html">Thanks!!&lt;br /&gt;&lt;br /&gt;I am using liferay 7 GA5 CE. &lt;br /&gt;&lt;br /&gt;I have referenced latest version com.liferay.dynamic.data.lists.form.web and this error is gone, but still it&amp;#39;s executing original code of DDLFormEmailNotificationSender class.</summary>
    <dc:creator>Dipti Ranparia</dc:creator>
    <dc:date>2018-04-30T15:39:28Z</dc:date>
  </entry>
  <entry>
    <title>RE: LR7 Custom email notification in Web Form portlet</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=107567944" />
    <author>
      <name>David H Nebinger</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=107567944</id>
    <updated>2018-04-30T14:23:36Z</updated>
    <published>2018-04-30T14:23:36Z</published>
    <summary type="html">&lt;div class="quote-title"&gt;Dipti Ranparia:&lt;/div&gt;&lt;blockquote&gt;problem with this class is i can not find com.liferay.dynamic.data.lists.form.web.internal.notification package to import and i think this is the problem.  because when i deploy this package i am getting DDLFormEmailNotificationSender NoClassDefFoundError error.&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;Your class doesn&amp;#39;t reference com.liferay.dynamic.data.lists.form.web.internal.notification.DDLFormEmailNotificationSender, it is extending com.liferay.dynamic.data.lists.form.web.notification.DDLFormEmailNotificationSender which doesn&amp;#39;t exist in later versions of the com.liferay.dynamic.data.lists.form.web bundle.&lt;br /&gt;&lt;br /&gt;I think you originally were extending from one of the older versions of the bundle that had that c.l.d.d.l.f.web.notification package, but the newer versions do not have that legacy package anymore.</summary>
    <dc:creator>David H Nebinger</dc:creator>
    <dc:date>2018-04-30T14:23:36Z</dc:date>
  </entry>
  <entry>
    <title>RE: LR7 Custom email notification in Web Form portlet</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=107565101" />
    <author>
      <name>Dipti Ranparia</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=107565101</id>
    <updated>2018-04-30T13:53:02Z</updated>
    <published>2018-04-30T13:53:02Z</published>
    <summary type="html">&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;Thanks for the reply David .&lt;br&gt;&lt;br&gt;My goal is to add file selction in web-form and attach that file with email notification. I have already created a custom form field to support file selection but getting error for file attacment customization.&lt;br&gt;&lt;br&gt;I have 2 bundles;&lt;br&gt;1. Fragment of dynamc-data-list-form-web with and one jsp file (display/view.jsp) to support multipart data  and bnd.bnd.&lt;br&gt; bnd.bnd file detail;&lt;br&gt;&lt;pre&gt;&lt;code&gt;Bundle-Name: dynamc-data-list-form-web-fragment
Bundle-SymbolicName: dynamc.data.list.form.web.fragment
Bundle-Version: 1.1.17
Fragment-Host: com.liferay.dynamic.data.lists.form.web;bundle-version="[1.0.0,2.0.0)"
Export-Package: \
	com.liferay.dynamic.data.lists.form.web.constants,\
	com.liferay.dynamic.data.lists.form.web.internal.notification\
Liferay-JS-Config: /META-INF/resources/admin/js/config.js
Liferay-Releng-Module-Group-Description:
Liferay-Releng-Module-Group-Title: Dynamic Data Lists
Web-ContextPath: /dynamic-data-lists-form-web
-dsannotations-options: inherit&lt;/code&gt;&lt;/pre&gt;&lt;br&gt;2. Module activator class  with custom DDLFormEmailNotificationSender class as below &lt;br&gt;&lt;pre&gt;&lt;code&gt;/**
 * 
 */
package custom.web.form.portlet.notification;

import java.lang.reflect.Field;

import javax.portlet.PortletRequest;

import org.osgi.service.component.annotations.Component;
import org.osgi.service.component.annotations.Reference;

import com.liferay.dynamic.data.lists.form.web.notification.DDLFormEmailNotificationSender;
import com.liferay.dynamic.data.lists.model.DDLRecord;
import com.liferay.dynamic.data.mapping.form.field.type.DDMFormFieldTypeServicesTracker;
import com.liferay.mail.kernel.service.MailService;
import com.liferay.portal.kernel.log.Log;
import com.liferay.portal.kernel.log.LogFactoryUtil;
import com.liferay.portal.kernel.service.UserLocalService;
import com.liferay.portal.kernel.util.Portal;

/**
 * Override this class to add attachment to email
 * 
 * @author diptivaghasia
 *
 */
@Component(immediate=true,
property={"service.ranking:Integer=100"},
service=DDLFormEmailNotificationSender.class
)

public class CustomDDLFormEmailNotificationSender extends  DDLFormEmailNotificationSender{

	@Override
	public void sendEmailNotification(PortletRequest portletRequest, DDLRecord record) {
		// TODO Auto-generated method stub		
		_log.info("sendEmailNotification");
		super.sendEmailNotification(portletRequest, record);
	}
	
	@Reference(unbind = "-")
	protected void setDDMFormFieldTypeServicesTracker(
		DDMFormFieldTypeServicesTracker ddmFormFieldTypeServicesTracker) {
		update("_ddmFormFieldTypeServicesTracker",ddmFormFieldTypeServicesTracker);
		
	}

	@Reference(unbind = "-")
	protected void setMailService(MailService mailService) {
		update("_mailService", mailService);
	}

	@Reference(unbind = "-")
	protected void setUserLocalService(UserLocalService userLocalService) {		
		update("_userLocalService", userLocalService);
	}
	@Reference(unbind = "-")
	protected void setPortal(Portal portal) {
		update("_portal", portal);
	}
	
	protected void update(final String fieldName, final Object value) {
		try {
			Field f = getClass().getSuperclass().getDeclaredField(fieldName);

			f.setAccessible(true);

			f.set(this, value);
		} catch (IllegalAccessException e) {
			_log.error("Error updating " + fieldName, e);
		} catch (NoSuchFieldException e) {
			_log.error("Error updating " + fieldName, e);
		}
	}

	private static final Log _log = LogFactoryUtil.getLog(CustomDDLFormEmailNotificationSender.class);
	
}
&lt;/code&gt;&lt;/pre&gt;&lt;br&gt;&lt;br&gt;problem with this class is i can not find com.liferay.dynamic.data.lists.form.web.internal.notification package to import and i think this is the problem.  because when i deploy this package i am getting DDLFormEmailNotificationSender NoClassDefFoundError error.&lt;br&gt;&lt;br&gt;This is my gradle file of the custom bundle i have a created for the custom DDLFormEmailNotificationSender.&lt;br&gt;&lt;pre&gt;&lt;code&gt;dependencies {
compileOnly group: "org.osgi", name: "org.osgi.core", version: "6.0.0"
compile group: "org.osgi", name:"org.osgi.service.component.annotations", version:"1.3.0"
compile group: "com.liferay", name:"com.liferay.dynamic.data.lists.api", version: "1.0.0"
 compileOnly group: "javax.servlet", name: "javax.servlet-api", version: "3.0.1"
compileOnly group: "javax.portlet", name: "portlet-api", version: "2.0"
 compile group: "com.liferay.portal", name:"com.liferay.portal.impl", version:"1.0.1"
 compile group: "com.liferay.portal", name:"com.liferay.portal.kernel", version:"1.0.3"
  compile group: "com.liferay", name: "com.liferay.dynamic.data.lists.form.web", version:"1.0.3"
compile group: "com.liferay", name:"com.liferay.dynamic.data.mapping.form.field.type", version:"2.0.0"
}
&lt;/code&gt;&lt;/pre&gt;&lt;br&gt;&lt;br&gt;Can you please tell me what is wrong with my code?&lt;br&gt;&lt;br&gt;Thanks for the help.&lt;/body&gt;&lt;/html&gt;</summary>
    <dc:creator>Dipti Ranparia</dc:creator>
    <dc:date>2018-04-30T13:53:02Z</dc:date>
  </entry>
  <entry>
    <title>RE: LR7 Custom email notification in Web Form portlet</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=107564261" />
    <author>
      <name>David H Nebinger</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=107564261</id>
    <updated>2018-04-30T13:23:09Z</updated>
    <published>2018-04-30T13:23:09Z</published>
    <summary type="html">&lt;div class="quote-title"&gt;Dipti Ranparia:&lt;/div&gt;&lt;blockquote&gt;I am not able to ovevrride &lt;strong&gt;DDLFormEmailNotificationSender&lt;/strong&gt; class using approach mentioned by David in the blog.&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;You should end up with two bundles:&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;A fragment bundle.  This bundle basically just has a bnd.bnd file, mostly copied from the original, but with the additional Export-Package directive addition.&lt;/li&gt;&lt;li&gt;An implementation bundle.  This bundle has your class which extends the original but returns a different soy template which is also in this bundle.&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;br /&gt;If you tried this, which part isn&amp;#39;t working?</summary>
    <dc:creator>David H Nebinger</dc:creator>
    <dc:date>2018-04-30T13:23:09Z</dc:date>
  </entry>
  <entry>
    <title>RE: LR7 Custom email notification in Web Form portlet</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=107561087" />
    <author>
      <name>Linda van der Pal</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=107561087</id>
    <updated>2018-04-30T12:16:13Z</updated>
    <published>2018-04-30T12:16:13Z</published>
    <summary type="html">No, I didn&amp;#39;t get it working. We chose a different route by creating an ugly hack: we created a storage provider that didn&amp;#39;t store the data, but sent an email instead.</summary>
    <dc:creator>Linda van der Pal</dc:creator>
    <dc:date>2018-04-30T12:16:13Z</dc:date>
  </entry>
  <entry>
    <title>RE: LR7 Custom email notification in Web Form portlet</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=107561070" />
    <author>
      <name>Dipti Ranparia</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=107561070</id>
    <updated>2018-04-30T12:11:57Z</updated>
    <published>2018-04-30T12:11:57Z</published>
    <summary type="html">Hi Linda,&lt;br /&gt;&lt;br /&gt;Are you able to make this working?&lt;br /&gt;&lt;br /&gt;I am not able to ovevrride &lt;strong&gt;DDLFormEmailNotificationSender&lt;/strong&gt; class using approach mentioned by David in the blog.</summary>
    <dc:creator>Dipti Ranparia</dc:creator>
    <dc:date>2018-04-30T12:11:57Z</dc:date>
  </entry>
  <entry>
    <title>RE: LR7 Custom email notification in Web Form portlet</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=106263170" />
    <author>
      <name>David H Nebinger</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=106263170</id>
    <updated>2018-04-05T14:30:48Z</updated>
    <published>2018-04-05T14:30:48Z</published>
    <summary type="html">Yeah, no you can&amp;#39;t do this.&lt;br /&gt;&lt;br /&gt;First the service declaration must match; using your own service means that only components that @Reference it are going to get it injected.&lt;br /&gt;&lt;br /&gt;Second, the fragment bundle can introduce new classes, but it doesn&amp;#39;t have a startable context of its own.  Normally you&amp;#39;d have to put your component overrides into a separate bundle from the fragment bundle so they start and register correctly.</summary>
    <dc:creator>David H Nebinger</dc:creator>
    <dc:date>2018-04-05T14:30:48Z</dc:date>
  </entry>
  <entry>
    <title>RE: LR7 Custom email notification in Web Form portlet</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=106260207" />
    <author>
      <name>Linda van der Pal</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=106260207</id>
    <updated>2018-04-05T13:09:10Z</updated>
    <published>2018-04-05T13:09:10Z</published>
    <summary type="html">&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;Thanks for the quick reply! &lt;br&gt;&lt;br&gt;Hmm, I did use the same package name, but changing that didn't solve the problem. And my class name was already different (I had prefixed the original name with the word Custom).&lt;br&gt;&lt;br&gt;&lt;pre&gt;&lt;code&gt;package finalist.form.mailer;

import com.liferay.dynamic.data.lists.form.web.internal.notification.DDLFormEmailNotificationSender;
import com.liferay.dynamic.data.lists.model.DDLRecord;
import com.liferay.dynamic.data.lists.model.DDLRecordSet;
import com.liferay.portal.kernel.exception.PortalException;
import com.liferay.portal.kernel.log.Log;
import com.liferay.portal.kernel.log.LogFactoryUtil;
import com.liferay.portal.kernel.template.Template;
import com.liferay.portal.kernel.template.TemplateConstants;
import com.liferay.portal.kernel.template.TemplateManagerUtil;
import com.liferay.portal.kernel.util.Portal;

import java.lang.reflect.Field;

import javax.portlet.PortletRequest;

import org.osgi.service.component.annotations.Component;
import org.osgi.service.component.annotations.Reference;

@Component(immediate = true, 
		service = DDLFormEmailNotificationSender.class,
		name = "CustomDDLFormEmailNotificationSender",
		property = {"service.ranking:Integer=100"})
public class CustomDDLFormEmailNotificationSender extends DDLFormEmailNotificationSender {
	
	private static final String _TEMPLATE_PATH =
			"/META-INF/resources/custom-mailtemplate.ftl";
	
	protected Template createTemplate(
			PortletRequest portletRequest, DDLRecordSet recordSet,
			DDLRecord record)
		throws PortalException {

		Template template = TemplateManagerUtil.getTemplate(
			TemplateConstants.LANG_TYPE_FTL,
			getTemplateResource(_TEMPLATE_PATH), false);

		populateParameters(template, portletRequest, recordSet, record);

		return template;
	}
	
	@Reference(unbind = "-")
	protected void setPortal(Portal portal) {
		update("_portal", portal);
	}
	
	protected void update(final String fieldName, final Object value) {
		try {
			Field f = getClass().getSuperclass().getDeclaredField(fieldName);

			f.setAccessible(true);

			f.set(this, value);
		} catch (IllegalAccessException e) {
			LOG.error("Error updating " + fieldName, e);
		} catch (NoSuchFieldException e) {
			LOG.error("Error updating " + fieldName, e);
		}
	}

	private static final Log LOG = LogFactoryUtil.getLog(CustomDDLFormEmailNotificationSender.class);
}
&lt;/code&gt;&lt;/pre&gt;&lt;br&gt;&lt;br&gt;&lt;pre&gt;&lt;code&gt;Bundle-Name: finalist-form-mailer
Bundle-SymbolicName: finalist.form.mailer
Bundle-Version: 1.0.0
Fragment-Host: com.liferay.dynamic.data.lists.form.web;bundle-version="[1.0.0, 2.0.0]"
Export-Package: com.liferay.dynamic.data.lists.form.web.constants,\
	com.liferay.dynamic.data.lists.form.web.internal.notification,\
	finalist.form.mailer;
Liferay-Releng-Module-Group-Description:
Liferay-Releng-Module-Group-Title: Dynamic Data Lists
-dsannotations-options: inherit&lt;/code&gt;&lt;/pre&gt;&lt;/body&gt;&lt;/html&gt;</summary>
    <dc:creator>Linda van der Pal</dc:creator>
    <dc:date>2018-04-05T13:09:10Z</dc:date>
  </entry>
  <entry>
    <title>RE: LR7 Custom email notification in Web Form portlet</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=106257981" />
    <author>
      <name>David H Nebinger</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=106257981</id>
    <updated>2018-04-05T12:58:00Z</updated>
    <published>2018-04-05T12:58:00Z</published>
    <summary type="html">You cannot have the same package/class name as a Liferay component.  OSGi will not allow that duplicate.&lt;br /&gt;&lt;br /&gt;To replace components, you need to implement the necessary service but use a higher service ranking so OSGi will want to use your service vs the original.</summary>
    <dc:creator>David H Nebinger</dc:creator>
    <dc:date>2018-04-05T12:58:00Z</dc:date>
  </entry>
  <entry>
    <title>RE: LR7 Custom email notification in Web Form portlet</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=106255792" />
    <author>
      <name>Linda van der Pal</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=106255792</id>
    <updated>2018-04-05T10:53:43Z</updated>
    <published>2018-04-05T10:53:43Z</published>
    <summary type="html">Did you ever solve this problem? I&amp;#39;m trying to do the same, but when I override the service as per David&amp;#39;s blog I get the following exception:&lt;br /&gt;&lt;br /&gt;09:21:08,351 ERROR [Refresh Thread: Equinox Container: f0ced4ed-ab38-0018-12ea-b6d5253daf22][com_liferay_dynamic_data_lists_form_web:97] [com.liferay.dynamic.data.lists.form.web.internal.notification.DDLFormEmailNotificationSender] Cannot register Component &lt;br /&gt;org.osgi.service.component.ComponentException: The component name &amp;#39;com.liferay.dynamic.data.lists.form.web.internal.notification.DDLFormEmailNotificationSender&amp;#39; has already been registered by Bundle 144 (com.liferay.dynamic.data.lists.form.web) as Component of Class com.liferay.dynamic.data.lists.form.web.internal.notification.DDLFormEmailNotificationSender&lt;br /&gt;&lt;br /&gt;I have a feeling that it might have to do with the fact that DDLFormEmailNotificationSender is a singleton, but can&amp;#39;t find confirmation of that.&lt;br /&gt;&lt;br /&gt;I&amp;#39;ve tried setting the name of my CustomDDLFormEmailNotificationSender  component explicitly, but that doesn&amp;#39;t help either.</summary>
    <dc:creator>Linda van der Pal</dc:creator>
    <dc:date>2018-04-05T10:53:43Z</dc:date>
  </entry>
</feed>
