Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-104305

[$SITE_NAME$] associated with assets are not coming in Asset Publisher's Email Subscription mail content

    Details

      Description

      When subscribe to Asset Publisher, the email content sent out does not resolve the site name associated with assets.

      Step to reproduce:

      1. Setup outgoing emails in Liferay:
        1. Go to Control Panel -> Server Administration -> Mail. Setup an outgoing SMTP server.
        2. Or another option, simply use a fake SMTP server like http://nilhcem.com/FakeSMTP/. In Unix/Linux, need to use sudo when starting the fakeSMTP.jar if you want to listen on port 25. This way, you do not need to use any real email address.
      2. Change your Liferay user's email address so that it won't be in blacklist.
      3. Go to any page and add an Asset Publisher portlet.
        1. Configure the Asset Publisher portlet: Three dots -> Configure -> Subscriptions -> Enable Email Subscriptions.
        2. Make sure the sender email address not in blacklist.
        3. Include [$SITE_NAME$] in the body template.
        4. Save
      4. Subscribe to that Asset Publisher portlet
        1. In 7.2+, you have to enable subscribe option in Three dots -> Configure -> Display Settings -> Subscribe
      5. Click on the + button and add any type of asset content (Document, Web Content, Blogs, etc...)
      6. Check the email sent. The common way is using these Groovy scripts:

      In 7.0.x, 7.1.x:

      import com.liferay.registry.RegistryUtil
      
      def registry = RegistryUtil.getRegistry()
      def assetPublisherUtil = registry.getService("com.liferay.asset.publisher.web.util.AssetPublisherUtil")
      def checkEntriesMethod = assetPublisherUtil.getClass().getMethod("checkAssetEntries")
      
      try {
      checkEntriesMethod.invoke(assetPublisherUtil)
      }
      catch (Exception e) {
      e.printStackTrace(out)
      }
      

      In 7.2 and master:

      import com.liferay.registry.RegistryUtil
       
      def registry = RegistryUtil.getRegistry()
      def assetEntriesCheckerUtil = registry.getService("com.liferay.asset.publisher.web.internal.messaging.AssetEntriesCheckerUtil")
      def checkEntriesMethod = assetEntriesCheckerUtil.getClass().getMethod("checkAssetEntries")
      
      try {
       checkEntriesMethod.invoke(assetEntriesCheckerUtil) 
      }
      catch (Exception e) { e.printStackTrace(out) }

       

       Actual Result

       [$SITE_NAME$] is coming as it is (refer the screenshot)

       Expected Result

      It should show the respective site name where the Asset resides

       

      Reproduced in
      fix-pack-de-51-7010 97a45286703cb71bfce8e37020f2811ac7b09479
      70x 28fdd6d51a325c76decc7aefc0571edd3f325f12

      7.1.x b86dce5043b76a3eec8d4a13faaaabf85f582d66
      7.2.x 16ac89bd81feaca7215f259a756b3ae483aa7f2e
      master f00dfe17d71655b51a7fe8f2589969918b503326

        Attachments

          Activity

            People

            • Assignee:
              yang.cao Yang Cao
              Reporter:
              ha.tang Ha Tang
              Participants of an Issue:
              Recent user:
              Enterprise Release HU
              Engineering Assignee:
              Ha Tang
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Days since last comment:
                3 weeks, 5 days ago

                Packages

                Version Package
                7.0.X
                7.1.X
                7.2.X
                Master