Email Notification upon Successful Data Entry

  • Last update:July 31, 2025
  • Overview

    Application Scenario

    In most companies, email communication serves as a common and critical communication method. An employee needs to send emails to notify relevant personnel upon task completion. How to realize the effect in FineReport? For example, emails are sent to relevant personnel when a record of data is successfully submitted to a database.

    Function Description

    You can add a Successful Data Entry event to send emails to the personnel who are responsible for a template upon successful data entry.

    Notes

    1. After automatic data entry through the task schedule, the Send Email event cannot be automatically executed.

    2. If cell values or widget values are used in the Send Email setting, data entry values cannot be obtained dynamically. Only initialized values are available.

    Example

    Example in this document:

    The built-in template LineForm1.cpt, located in FineReport installation directory\webapps\webroot\WEB-INF\reportlets\doc-EN\Form\LineForm, is used.

    Upon successful data entry by a submitter, the system will automatically send an email notification to Lisa (the person who is responsible for the template), and CC the notification to the submitter and supplier.

    Setting the Sender

    An email sender must be set. Otherwise, emails cannot be successfully sent. You only need to set the sender for each decision-making system once.

    Log in to the decision-making system as the admin, choose System Management > System Setting > Mailbox, add a sender, set System Default Sender, and click OK, as shown in the following figure.

    iconNote:

    1. The configuration steps may vary depending on the mail server. For details, see Email Service.

    2. After configuration, click Send Test Mail to check whether the email is available.

    3. If the default sender of the system is not configured, you cannot set the Send Email event in section "Setting the Sending Email Event." Besides, a prompt saying "Visit the platform or contact the admin to configure the sender mailbox." will be displayed.

    1.png

    Setting the Recipient

    In the event, emails need to be sent to Lisa and the submitter. Therefore, you need to bind their email addresses.

    Log in to the decision-making platform as the admin, choose System Management > User Management > All Users, click the icon to edit the user information of Lisa (the sales leader), enter the email address, and click OK, as shown in the following figure.

    iconNote:
    This example only demonstrates how to configure the mailbox for users in the system. The admin can also configure mailboxes when synchronizing or manually adding users. For details, see User Adding and User Synchronization.

    2.png

    3.png

    After the mailboxes are configured, the following figure shows the effect.

    4.png

    Setting the Sending Email Event

    Open the template LineForm1.cpt in FineReport installation directory\webapps\webroot\WEB-INF\reportlets\doc-EN\Form\LineForm.

    1. Choose Template > Web Attribute on the menu bar, click Data Entry Setting based on the template preview method, and select Set for This Template Separately from the drop-down list of Following Settings.

    2. Click +, select Successful Data Entry, and set Event Type to Send Email.

    3. Set the JS code as shown in the following figure, save the setting, and save the template.

    The following table describes the JS setting of the Send Email event.

    Setting ItemDescriptionExample

    Recipient

    CC

    BCC

    You can manually enter the recipient address, and separate multiple recipients with commas (,).

    Three writing methods are available:

    1. Usernames in the decision-making   system (Emails will be sent to the mailboxes bound to the users.)

    2. Specific email addresses

    3. Parameter ${abc} (abc represents   the parameter name, and emails will be sent to the corresponding email   addresses of the parameter.)

    Lisa: Emails will be sent to the mailbox bound to user Lisa.

    ${fine_username}: Emails will be sent to the mailbox of the current login user.

    Subject

    Subject refers to the email subject. The formula ${today()} is supported.

    ${today()} Inventory Update

    Body

    Body refers to the email body.

    The formula ${today()} is supported.

    The parameter ${abc} is supported.

    Dear colleagues, please note that our inventory records have been updated.

    Update Date: ${today()}

    Update Person:${fine_username}

    Update Details: Refer to the following part.

    Preview Report Content in Body

    The report content is displayed in the email body.

    /

    Mounting the Template to the Directory

    Log in to the decision-making platform as the admin, and choose System Management > Directory Management > Directory Management, and click Add Template, as shown in the following figure.

    6.png

    Select the template created in section "Setting the Sending Email Event", and click Next.

    Set the directory name to Sending Emails upon Successful Data Entry, set the mounting type to Data Entry, and click OK. In this case, the template is mounted to the main directory of the decision-making system.

    7.png

    Assigning Directory Viewing Permissions

    Log in to the decision-making system as the admin, choose System Management > Permission Management > Common Permission Configuration, and select a department/role/user as the permission carrier. In this example, Sales department is selected from the department.

    Select the Directory Permission tab and assign Sales department the permission to view the directory Sending Emails upon Successful Data Entry, as shown in the following figure.

    8.png

    Effect Preview

    Log in to the decision-making system as hanwen (hanwen, 123456), a user of the sales department, and open the directory Sending Emails upon Successful Data Entry.

    After data entry of the inventory information, click the Submit button.

    1. A pop-up box saying "Success" is displayed, representing successful data entry.

    2. A pop-up box saying "Sent Successfully" is displayed, representing that the email is successfully sent.

    9.png

    Meanwhile, hanwen, Lisa, and the supplier all receive the email, as shown in the following figure.

    10.png

    Notes

    Problem:

    A prompt saying "Sent Failed. Please check the mail server configuration, make sure that the SMTP mail server, username, password, and recipient address are filled in correctly, and make sure the network is smooth." is displayed upon email sending, as shown in the following figure.

    11.png

    Troubleshooting step 1:

    The sender is not correctly configured in the decision-making system. For details about how to configure the email server, see section "Setting the Sender."

    Troubleshooting step 2:

    The manually entered username does not belong to a user included in the data-decision system.

    Check whether a manually entered username does not belong to a user included in the decision-making system.

    Troubleshooting step 3:

    No recipient is selected. Or no mailbox is bound to the selected recipient.

    Check whether the recipient is configured. For details about how to configure the recipient mailbox, see section "Setting the Recipient."

    iconNote: 
    If some user's email addresses are empty, other users configured with email addresses can receive emails without being affected.

    Attachment List


    Theme: Decision-making Platform
    • Helpful
    • Not helpful
    • Only read

    滑鼠選中內容,快速回饋問題

    滑鼠選中存在疑惑的內容,即可快速回饋問題,我們將會跟進處理。

    不再提示

    10s後關閉

    Get
    Help
    Online Support
    Professional technical support is provided to quickly help you solve problems.
    Online support is available from 9:00-12:00 and 13:30-17:30 on weekdays.
    Page Feedback
    You can provide suggestions and feedback for the current web page.
    Pre-Sales Consultation
    Business Consultation
    Business: international@fanruan.com
    Support: support@fanruan.com
    Page Feedback
    *Problem Type
    Cannot be empty
    Problem Description
    0/1000
    Cannot be empty

    Submitted successfully

    Network busy