<?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>Subscriber Notification when Adding file programatically</title>
  <link rel="self" href="https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=109789115" />
  <subtitle>Subscriber Notification when Adding file programatically</subtitle>
  <id>https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=109789115</id>
  <updated>2026-04-06T09:36:30Z</updated>
  <dc:date>2026-04-06T09:36:30Z</dc:date>
  <entry>
    <title>RE: Subscriber Notification when Adding file programatically</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=113449208" />
    <author>
      <name>Andrew Jardine</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=113449208</id>
    <updated>2019-04-29T13:05:55Z</updated>
    <published>2019-04-29T13:05:55Z</published>
    <summary type="html">Ok. I think maybe I didn&amp;#39;t understand your original problem then. I thought the issue was that the email was not being sent out ... Not that it had the wrong link.&lt;br /&gt;&lt;br /&gt;If it&amp;#39;s just the link you are looking for, the configuration is not the worst solution, but also not ideal as you now have a dependency on liferay not changing something in the future. You&amp;#39;d be better to use the api to generate the url so that if the logic for a generated url changes, you get the changes automatically.&lt;br /&gt;&lt;br /&gt;​​​​​​​Just some food for thought.</summary>
    <dc:creator>Andrew Jardine</dc:creator>
    <dc:date>2019-04-29T13:05:55Z</dc:date>
  </entry>
  <entry>
    <title>RE: Subscriber Notification when Adding file programatically</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=113440253" />
    <author>
      <name>Kratiyag Gupta</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=113440253</id>
    <updated>2019-04-29T04:32:35Z</updated>
    <published>2019-04-29T04:32:35Z</published>
    <summary type="html">Well it turn out it is not possible without providing the configuration. The solution I followed, I created a configuration where I provide my QA and Prod URL and whever the mail is triggered it find which environment it is and concatinate the file path with the specific URL. </summary>
    <dc:creator>Kratiyag Gupta</dc:creator>
    <dc:date>2019-04-29T04:32:35Z</dc:date>
  </entry>
  <entry>
    <title>RE: Subscriber Notification when Adding file programatically</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=113307024" />
    <author>
      <name>Andrew Jardine</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=113307024</id>
    <updated>2019-04-19T16:33:13Z</updated>
    <published>2019-04-19T16:33:13Z</published>
    <summary type="html">Hi srini,&lt;br /&gt;&lt;br /&gt;I didn&amp;#39;t dig for hours into the source, but in the 10 or 15 minutes that I spent looking through a few classes I didn&amp;#39;t see the reference. For sure it is there though so if you really want to know how Liferay is doing it, then for sure you will find it in the source. Alternatively you could manage sending the email yourself by leveraging the SubscriptionLocalService and the MailUtil that Liferay provides. &lt;br /&gt;&lt;br /&gt;The SubscriptionLocalService can be used to look up the users who are subscribed to the folder that the file is being added to and then you can use the MailUtil to send the message. &lt;br /&gt;&lt;br /&gt;For the record, and I haven&amp;#39;t checked this to be honest but, I think the subscription to folders is only a feature web content folders. As far as I know there is no such feature for the documents and media folders. &lt;br /&gt;&lt;br /&gt;​​​​​​​</summary>
    <dc:creator>Andrew Jardine</dc:creator>
    <dc:date>2019-04-19T16:33:13Z</dc:date>
  </entry>
  <entry>
    <title>RE: Subscriber Notification when Adding file programatically</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=113305704" />
    <author>
      <name>srini vasulu</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=113305704</id>
    <updated>2019-04-19T15:57:08Z</updated>
    <published>2019-04-19T15:57:08Z</published>
    <summary type="html">&lt;blockquote&gt;Andrew JardineHi Srini, &lt;br /&gt;&lt;br /&gt;Looking at the Liferay source code, I don&amp;#39;t see anything in any of the addFileEntry methods that sends out notifications. How are you trying to use it? Are you trying to use this service in a custom portlet?&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;Yes in from custom portlet i am adding file.</summary>
    <dc:creator>srini vasulu</dc:creator>
    <dc:date>2019-04-19T15:57:08Z</dc:date>
  </entry>
  <entry>
    <title>RE: Subscriber Notification when Adding file programatically</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=113288369" />
    <author>
      <name>Andrew Jardine</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=113288369</id>
    <updated>2019-04-19T00:20:52Z</updated>
    <published>2019-04-19T00:20:52Z</published>
    <summary type="html">Hi Srini, &lt;br /&gt;&lt;br /&gt;Looking at the Liferay source code, I don&amp;#39;t see anything in any of the addFileEntry methods that sends out notifications. How are you trying to use it? Are you trying to use this service in a custom portlet?</summary>
    <dc:creator>Andrew Jardine</dc:creator>
    <dc:date>2019-04-19T00:20:52Z</dc:date>
  </entry>
  <entry>
    <title>RE: Subscriber Notification when Adding file programatically</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=113286557" />
    <author>
      <name>srini vasulu</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=113286557</id>
    <updated>2019-04-18T19:31:29Z</updated>
    <published>2019-04-18T19:31:29Z</published>
    <summary type="html">Hi ,&lt;br /&gt;Did you resolved the issue i am also facing same issue.</summary>
    <dc:creator>srini vasulu</dc:creator>
    <dc:date>2019-04-18T19:31:29Z</dc:date>
  </entry>
  <entry>
    <title>Subscriber Notification when Adding file programatically</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=109789114" />
    <author>
      <name>Kratiyag Gupta</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=109789114</id>
    <updated>2018-06-11T15:57:47Z</updated>
    <published>2018-06-11T15:57:47Z</published>
    <summary type="html">&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;Hi Liferay Folks,&lt;br&gt;I'm adding a file in documents and media folder in liferay programatically. I know that all those user who have permission to  view and subscribe the folder will get a notification through email once a new document is added but in my case it is not happening.&lt;br&gt;&lt;br&gt;I'm adding file using following approach:-&lt;br&gt;&lt;pre&gt;&lt;code&gt;DLAppLocalServiceUtil.addFileEntry(
			userId, companyGroup.getGroupId(), folder.getFolderId(), fileName,
			ContentTypes.TEXT_CSV_UTF8, csvContent.getBytes(), serviceContext);&lt;/code&gt;&lt;/pre&gt;&lt;br&gt;Since I'm adding the file programmatically and the file added successfully but the mail notification is not triggerring&lt;/body&gt;&lt;/html&gt;</summary>
    <dc:creator>Kratiyag Gupta</dc:creator>
    <dc:date>2018-06-11T15:57:47Z</dc:date>
  </entry>
</feed>
