When triggering a subscription notification from a layout with a virtual host, some of the terms sent in the notification do not use the correct virtual host for the links.
Steps to reproduce:
Setup: Setup an SMTP server so you can see emails. I suggest using http://nilhcem.com/FakeSMTP/ as it is a standalone .jar file that listens for SMTP.
Make sure the SMTP port FakeSMTP is using matches the one Liferay is using at Control Panel -> Server Administration -> Mail -> Outgoing SMTP Server
- Create a new site.
- Set a virtual hostname for the site's public and private layoutSet.
- Once created, begin to use the virtual host when navigating through the site.
- Create a page with a blogs portlet.
- Create a new user and have that user subscribe to the blogs portlet created in step 4.
- Using the admin user, create a new blog entry from the new site
- View the email sent to the user created in step 5
Expected Results: All links in the email point to the portal using the virtual hostname created in step 2
Actual Results: All the links use the default hostname (localhost).
Reproduced on master: c949be00bdb40ca0b547d477cbaa1646fde3f2b2