I. Overview
In most enterprises, email communication is a very common and important communication tool. Often, when an employee completes an event, he/she needs to notify all relevant personnel by email. Then how should FineReport realize this, for example, when filling in a data into the database, he/she needs to notify relevant personnel by email?
II. Example - (Custom button)
Here is a simple example of how FineReport can send mail.
Select recipients from the drop-down check box on the parameter interface. Click the button to send the email addresses of all recipients as the email body and the date of the day as the email title.
1) Preparing templates
Create a new blank template ,Add a parameter person in the Template >Template Parameters, and add the parameter widget to the parameter panel. Select the drop-down check box for widget type, and set the data dictionary as shown below:
2) Sender settings
The recipient email address has been set. The sender email address is set.
Type http://localhost:8075/webroot/decision in your browser, login with administrator account, click on the Manage>System>Emailbox, you can configure the sender email, as shown below:
Note: How to obtain the authorization code? Check how to enable POP3/SMTP service and generate the authorization code
Note: FR supports only one sender and cannot change dynamically.
For details about how to configure sender email, see Email service.
Click the Save button and the sender's mailbox is configured.
3) Sending an email
Return to the template, switch to the parameter interface, select the query button, select the event TAB in the property panel on the right, add a click event, and select send email as the response mode of the event, as shown below:
Note: Formulas are supported for both body and title.
4) Effect viewing
Select SUSIE and Caixiaolan from the drop-down box and click the query button to trigger the click event to send the email to josie and min.chen, as shown below. FineReport will send the above email to josie and min.chen
III. Example 2 (Built-in button on the Web)
When viewing reports on the Web side, FineReport also has a mail button in the built-in toolbar. Click the button to directly send emails. For example, if we preview GettingStarted template, we can see the mail button on the Web side toolbar.
Note: Sent messages are displayed in HTML and can be copied.