The Message module provides several features for delivering emails:
Freddie Mac wishes to email their users a list of work items each night. For most QBO systems, such work items include potentially Non-Public Information (NPI), so sending the raw data in the clear is a bad practice. Instead, an email containing the number of work items, with a hyperlink directly to the appropriate Smart Worklist view, is the preferred practice.
The items a user is eligible to work is determined by the Smart Worklist module, defined by the statement 'PersonEligible'. Sample output is:
For this use case, we shall copy the basic PersonEligible statement to the Person/Config, and extend it to include an AsOfDate column.
Create a Message Template
A Message Template that applies to the Person table will be used to control the body of the email. For this use case, we shall name the template 'Nightly Worklist'. The BodyHtml should look something like:
You can manually test this as follows:
Create a Data Listener
A data listener take the output of a query, and for each row returned, invokes some operation. In this case, we shall create a data listener against the Person table called 'Nightly Worklist', with the following properties:
When the data listener runs, each row returned by the new Person/PersonEligible statement will cause a Message/Send operation to be queued with the parameters above. Essentially, we invoke the manual test above for each row returned by the data listener query.
To invoke the data listener manually:
Schedule the Data Listener