<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Configure custom notification email in Nuxeo Forum</title>
    <link>https://connect.hyland.com/t5/nuxeo-forum/configure-custom-notification-email/m-p/326317#M13318</link>
    <description>&lt;P&gt;I finally got it working&lt;/P&gt;</description>
    <pubDate>Mon, 12 Dec 2011 22:59:26 GMT</pubDate>
    <dc:creator>mcaissie_</dc:creator>
    <dc:date>2011-12-12T22:59:26Z</dc:date>
    <item>
      <title>Configure custom notification email</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/configure-custom-notification-email/m-p/326313#M13314</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I am trying to configure Nuxeo to use a custom template when sending "Modification alert" email notification.
Here is what i done so far..&lt;/P&gt;
&lt;P&gt;From a working installation  (meaning that i subscribed on Modification alert  and  if i modify a folder i correctly get a modification notification email)&lt;/P&gt;
&lt;P&gt;STEP  1: Removing the default modification notification&lt;/P&gt;
&lt;P&gt;In the nuxeo-platform-notification-core-5.4.2&lt;/P&gt;
&lt;P&gt;i modified  notification-contribution.xml to disable the Modification notification by setting  enabled="false"&lt;/P&gt;
&lt;P&gt;&lt;NOTIFICATION name="Modification" channel="email" enabled="false" availablein="Workspace" autosubscribed="false" template="modif" subject="Document modified" label="label.nuxeo.notifications.modif"&gt;
&lt;EVENT name="documentModified"&gt;&lt;/EVENT&gt;
&lt;/NOTIFICATION&gt;&lt;/P&gt;
&lt;P&gt;The result was that the Modification option disapeared from the Alert interface  as expected, and i stoped receiving notification email on modification of the folder.  So far so good...&lt;/P&gt;
&lt;P&gt;STEP 2: Adding a custom modification notification&lt;/P&gt;
&lt;P&gt;1-i added in my own  custom  .jar (which i use to expose custom services) a copy of&lt;BR /&gt; /&amp;gt;
OSGI-INF/notification-contribution.xml (with Modification  enable="true")&lt;/P&gt;
&lt;P&gt;2-i added 	a custom  src/templates/modif.ftl&lt;/P&gt;
&lt;P&gt;3-i added in the MANIFEST.FM a  Nuxeo-Component: OSGI-INF/notification-contrib.xml&lt;/P&gt;
&lt;P&gt;4-Restart.....&lt;/P&gt;
&lt;P&gt;The result is that i now have the Modification option back in the interface, and if i modify the folder i get a notification email,  except that i am not getting the custom modif.ftl  template  but still the default one.&lt;/P&gt;
&lt;P&gt;Can someone indicates to me what is missing so i can get a custom  email notification ?&lt;/P&gt;
&lt;P&gt;Thanks
Michel&lt;/P&gt;</description>
      <pubDate>Thu, 08 Dec 2011 22:41:19 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/configure-custom-notification-email/m-p/326313#M13314</guid>
      <dc:creator>mcaissie_</dc:creator>
      <dc:date>2011-12-08T22:41:19Z</dc:date>
    </item>
    <item>
      <title>Re: Configure custom notification email</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/configure-custom-notification-email/m-p/326314#M13315</link>
      <description>&lt;P&gt;ARrrrrglll !!!
Did you modify the file into the nuxeo-platform-notification-core-5.4.2 ? Bad, really bad &lt;span class="lia-unicode-emoji" title=":grinning_face_with_smiling_eyes:"&gt;😄&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;In fact Nuxeo is extensible and you can override easily with your own bundle (Nuxeo jar) the Nuxeo ones. This is the philosophy of the platform. We provide a Framework and some Modules (DM, DAM, Social-Collaboration, ...) that can be a starting point for you. And you can override each part of the module.&lt;/P&gt;
&lt;P&gt;So for your point you are near:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;DON'T TOUCH INTO THE NUXEO JAR ! I insist&lt;/LI&gt;
&lt;LI&gt;Do your step 2 but in your notification.xml file you must check that&lt;/LI&gt;
&lt;/OL&gt;
&lt;UL&gt;
&lt;LI&gt;the name of the component at the beginning of your XML file is different of the nuxeo ones. For instance &lt;CODE&gt;&amp;lt;component name="com.yourcomapny.yourprojectname.ecm.platform.notification.service.NotificationContrib"&amp;gt;&lt;/CODE&gt;&lt;/LI&gt;
&lt;LI&gt;you must add this &lt;CODE&gt;&amp;lt;require&amp;gt;org.nuxeo.ecm.platform.notification.service.NotificationContrib&amp;lt;/require&amp;gt;&lt;/CODE&gt; (this is the name of the component that contains the contribution you want to override.&lt;/LI&gt;
&lt;LI&gt;you must disable the default contribution as &lt;A href="https://jira.nuxeo.com/browse/NXP-8105" target="test_blank"&gt;https://jira.nuxeo.com/browse/NXP-8105&lt;/A&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;With the &lt;STRONG&gt;require&lt;/STRONG&gt; you ask to the runtime to deploy your contribution AFTER the Nuxeo one. As you give the same name of the notification, the service will override with yours.&lt;/P&gt;
&lt;P&gt;So your contribution must be something like:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;&amp;lt;?xml version="1.0" encoding="UTF-8"?&amp;gt;
&amp;lt;component name="com.caristix.nuxeo.ecm.platform.notification.service.NotificationContrib"&amp;gt;
  &amp;lt;require&amp;gt;org.nuxeo.ecm.platform.notification.service.NotificationContrib&amp;lt;/require&amp;gt;
  &amp;lt;extension target="org.nuxeo.ecm.platform.ec.notification.service.NotificationService" point="notifications"&amp;gt;
    &amp;lt;notification name="Modification" enabled="false"&amp;gt;&amp;lt;/notification&amp;gt;
    &amp;lt;notification name="Modification" channel="email" availablein="Workspace" autosubscribed="true"
      template="yourtemplate" subject="Document modified" 
      label="label.nuxeo.notifications.modif"&amp;gt; 
      &amp;lt;event name="documentModified"/&amp;gt;
    &amp;lt;/notification&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Last point, you can use the new Nuxeo version, Nuxeo 5.5 that brings really cool features..&lt;/P&gt;
&lt;P&gt;Hope this will be the solution &lt;span class="lia-unicode-emoji" title=":grinning_face_with_smiling_eyes:"&gt;😄&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Dec 2011 22:58:48 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/configure-custom-notification-email/m-p/326314#M13315</guid>
      <dc:creator>Benjamin_Jalon1</dc:creator>
      <dc:date>2011-12-08T22:58:48Z</dc:date>
    </item>
    <item>
      <title>Re: Configure custom notification email</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/configure-custom-notification-email/m-p/326315#M13316</link>
      <description>&lt;P&gt;Hi bjalon , tx for your quick answer&lt;/P&gt;</description>
      <pubDate>Thu, 08 Dec 2011 23:50:00 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/configure-custom-notification-email/m-p/326315#M13316</guid>
      <dc:creator>mcaissie_</dc:creator>
      <dc:date>2011-12-08T23:50:00Z</dc:date>
    </item>
    <item>
      <title>Re: Configure custom notification email</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/configure-custom-notification-email/m-p/326316#M13317</link>
      <description>&lt;P&gt;First:&lt;/P&gt;
&lt;P&gt;If i put  &lt;NOTIFICATION name="Modification" enabled="false"&gt;&lt;/NOTIFICATION&gt; , it disable also the one i want to add.&lt;/P&gt;
&lt;P&gt;Here is what i just tried;
1- I disable the &amp;lt;notification name="Modification"
2- I created a new &amp;lt;notification name="Modification2"    with a different name but using the same event.&lt;/P&gt;
&lt;P&gt;The only problem remaining is to use the custom .ftl file  i put in my own  src/templates  folder  in my .jar. I am still receiving the  default  modification email template.&lt;/P&gt;
&lt;P&gt;So i guess i need something in the  NotificationService extension so that
&lt;TEMPLATE name="modif" src="https://connect.hyland.com/templates/modif.ftl"&gt;&lt;/TEMPLATE&gt;   points to the
src/templates folder in my .jar  and not in the default  templates folder&lt;/P&gt;
&lt;P&gt;Any hint on this ?&lt;/P&gt;

&lt;P&gt;&lt;COMPONENT name="com.caristix.ecm.platform.notification.service.NotificationContrib"&gt;&lt;/COMPONENT&gt;&lt;/P&gt;
&lt;P&gt;&lt;REQUIRE&gt;org.nuxeo.ecm.platform.notification.service.NotificationContrib&lt;/REQUIRE&gt;&lt;/P&gt;
&lt;P&gt;&lt;EXTENSION target="org.nuxeo.ecm.platform.ec.notification.service.NotificationService" point="notifications"&gt;&lt;/EXTENSION&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;&amp;lt;notification name="Subscriptions updated" channel="email" enabled="true" availableIn="Workspace"
  autoSubscribed="true" template="subscriptionsUpdated" subject="New subscription" label="label.nuxeo.notifications.subscriptions.updated"&amp;gt;
  &amp;lt;event name="subscriptionAssigned"/&amp;gt;
&amp;lt;/notification&amp;gt;

&amp;lt;notification name="Modification" channel="email" enabled="false" availableIn="Workspace"
  autoSubscribed="false" template="modif" subject="Document modified" label="label.nuxeo.notifications.modif"&amp;gt;
  &amp;lt;event name="documentModified"/&amp;gt;
&amp;lt;/notification&amp;gt;

&amp;lt;notification name="Modification2" channel="email" enabled="true" availableIn="Workspace"
  autoSubscribed="false" template="modif" subject="Document modified" label="label.nuxeo.notifications.modif"&amp;gt;
  &amp;lt;event name="documentModified"/&amp;gt;
&amp;lt;/notification&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;
  
&lt;P&gt;&lt;EXTENSION target="org.nuxeo.ecm.platform.ec.notification.service.NotificationService" point="templates"&gt;&lt;/EXTENSION&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;&amp;lt;template name="subscriptionsUpdated" src="templates/subscriptionsUpdated.ftl" /&amp;gt;
&amp;lt;template name="modif" src="templates/modif.ftl" /&amp;gt;


&amp;lt;template name="defaultNotifTemplate" src="templates/defaultNotifTemplate.ftl" /&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 09 Dec 2011 18:00:05 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/configure-custom-notification-email/m-p/326316#M13317</guid>
      <dc:creator>mcaissie_</dc:creator>
      <dc:date>2011-12-09T18:00:05Z</dc:date>
    </item>
    <item>
      <title>Re: Configure custom notification email</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/configure-custom-notification-email/m-p/326317#M13318</link>
      <description>&lt;P&gt;I finally got it working&lt;/P&gt;</description>
      <pubDate>Mon, 12 Dec 2011 22:59:26 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/configure-custom-notification-email/m-p/326317#M13318</guid>
      <dc:creator>mcaissie_</dc:creator>
      <dc:date>2011-12-12T22:59:26Z</dc:date>
    </item>
    <item>
      <title>Re: Configure custom notification email</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/configure-custom-notification-email/m-p/326318#M13319</link>
      <description>&lt;P&gt;If your are using maven, you need to put your templates in src/main/resources/templates&lt;/P&gt;</description>
      <pubDate>Tue, 06 Mar 2012 18:15:14 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/configure-custom-notification-email/m-p/326318#M13319</guid>
      <dc:creator>patrek</dc:creator>
      <dc:date>2012-03-06T18:15:14Z</dc:date>
    </item>
  </channel>
</rss>

