I would like to customize the template of the email sent about flagged Message Boards posts
How To articles are not official guidelines or officially supported documentation. They are community-contributed content and may not always reflect the latest updates to Liferay DXP. We welcome your feedback to improve How To articles!
While we make every effort to ensure this Knowledge Base is accurate, it may not always reflect the most recent updates or official guidelines.We appreciate your understanding and encourage you to reach out with any feedback or concerns.
Legacy Article
You are viewing an article from our legacy "FastTrack"
publication program, made available for informational purposes. Articles
in this program were published without a requirement for independent
editing or verification and are provided"as is" without
guarantee.
Before using any information from this article, independently verify its
suitability for your situation and project.
Issue
- When a user flags a message as inappropriate in Message Boards, the admin user receives an email notification.
- I would like to customize the subject and the body of this email template.
Environment
Resolution
- The original template files are located in \liferay_home\osgi\marketplace\Liferay Collaboration - Liferay Flags - Impl.lpkg\com.liferay.flags.service-version.jar\com\liferay\flags\dependencies (email_flag_body.tmpl & email_flag_subject.tmpl)
- You will need to override these files to modify the template.
- You will have to create a fragment module, using the following steps (original documentation: Fragment Template).
- Create a fragment module:
blade create -t fragment -h com.liferay.flags.service -H 3.0.9 FlagsCustomMailTemplate
- Copy your customized template files into src\main\resources\com\liferay\flags\dependencies (custom_email_flag_body.tmpl & custom_email_flag_subject.tmpl)
- Build the project using:
gradlew build
- The jar file will be created in the build\libs directory
- Deploy the created jar (flagscustommailtemplate-1.0.0.jar)
- In Control Panel > Instance Settings > Community Tools, update the settings for the template files as follows:
Email Body: com/liferay/flags/dependencies/custom_email_flag_body.tmpl
Email Subject: com/liferay/flags/dependencies/custom_email_flag_subject.tmpl
Control Panel in DXP 7.3:

Did this article resolve your issue ?