legacy-knowledge-base
公開されました Jun. 30, 2025

How to send Form submission notification for Guest user

投稿者

Alexandre Heredia

knowledge-article-header-disclaimer-how-to

knowledge-article-header-disclaimer

legacy-article

learn-legacy-article-disclaimer-text

Issue

  • Form submission notifications usually are meant to be sent to already created users.
  • Is there a way to send form submission notifications for a Guest user?

Environment

  • Liferay DXP 7.4+

Resolution

Yes, there is. It's not a direct approach, and several steps must be made in order to achieve this.

You will need to create an Object with after submission Actions and link it to the Form. An Object is a way to create custom applications within Liferay, that becomes an entity within the database, and it is possible to add rules and actions that will be performed as soon a new register is added.

To create an Object, folow these steps:

  1. Go to Control Panel  Objects and create a new object.
  2. Give the object a name (for example: "Form Notification") and a plural name ("Form Notifications")
  3. Save the object.
  4. In the Objects list, locate the newly created object and click on its name to edit it.
  5. In the Fields tab, click on the "+" button in the upper right corner and add the corresponding form fields, with their respective types. Make sure to create the "Email" field.
  6. Return to the "Details" tab and click on the "Publish" button to finish creating the object.

Next, you need to create a template for the email to be sent.

  1. Go to Control Panel  Templates and click on the "+" button in the upper right corner to create a new template. Choose the "Email" option
  2. Fill out the form to create the template. The required fields are:
    • Name (the name of the template - choose something you can remember)
    • Configuration - Sender - Email address (e.g. noreply@test.com) and Name (e.g. Admin)
    • Primary recipients - Type (select "User's email address")
    • Recipients: [%OBJECTNAME_EMAIL%]*
    • Subject
    • Editor type (you can choose Rich Text or Freemarker)
    • Template (The content of the message to be sent)

Once you have finished filling out the form, click on "Save".

* This field must be filled in with the correct term corresponding to the previously created Object. To find the correct term, scroll down to the end of the template creation form, in the "Term Definition" section and, in the "Entity" menu, select the created object. All the object's fields will be listed, with their respective term definitions.

Now you need to create the notification action on the created object, using this template.

  1. Go back to Control Panel - Objects and click on the name of the created object on the list.
  2. In the "Actions" tab, click on the "+" button in the upper left corner to create a new action.
  3. In the form that opens, in the "Basic Information" tab, name the Action Label (e.g. "Submit Action")
  4. In the Action Builder tab, select the following options:
    • Trigger - When - After editing
    • Action - After - Notification and select the created template.

 5. Click on "Save"

Finally, you need to create a form and link the form to the object.

  1. On the form creation screen, click on the gear icon on the top menu.
  2. On the "General" tab, select the "Object" storage type.
  3. Select the object you created.

Done. Now, when the user submits the form, he will receive an email with the format defined by the template.

Additional Information

did-this-article-resolve-your-issue

legacy-knowledge-base