How to Send Reports Attached to Email Notifications

Did You Know?

With Hexagon EAM Messenger you can send an e-mail notification that includes a report. Suppose you want an e-mail notification sent to your main contact at the supplier of the Purchase Order you just approved. I know of some companies that want to automatically send a Preventive Maintenance Work Order to the contractor that normally does the work. All of this is doable with Hexagon EAM. Here’s how:

Setting up Email Notifications

The first thing you need to do is make sure you have e-mail notifications working. There are three things that need to be configured before you go to town sending automatic e-mails. First go to Administration | Security | Install Parameters. Query for SMTP and you will find SMTPSEND which is nothing more than the name of the e-mail sender used for replying to the messages.

Most people enter You will also find SMTPSERV which is the SMTP mail server that sends the e-mail. If you’re in the cloud the SMTPSERV record will be read only, because the cloud team handles it for you. For users hosted on premise, enter your mail server.

Next, you need to go to Administration | Data Collection | Job Setup and make sure the MAIL driver is active. If it is active, it should have a last run and next run date/timestamp. If it’s not active, and you check active and hit save, be prepared to wait a little while for it to fire up.

Now you’re ready to go.
Hexagon EAM E-Mail Messenger has three components:

• Viewer: Where you see what e-mail messages were sent or failed.
• Template: Where you determine where the e-mail goes and what’s in the subject and body of the e-mail and what report to attach if you choose to do so.
• Notification Setup: Where you select the table, conditions, parameters and other trimmings for the e-mail notification.
Once you get it all setup it will run like a champ. Just remember there are a lot of moving parts so attention to detail is critical. I know administrators who have accidentally sent hundreds of e-mail notifications by not paying attention to detail.

Attaching a PDF Report:

To send an automatic e-mail message with a report attached as a PDF go to the message template under Administration | E-Mail Messenger | E-Mail Templates. On the bottom of the screen you select the report you want to send with the e-mail message. Now comes the tricky part. In the E-mail Recipients field enter %1. This parameter will tell it who to send the e-mail message to.

Specify a table:
I’m assuming you know how to complete the rest of the template, so let’s move on to the important stuff. When you go to Administration | E-Mail Messenger | E-Mail Notification Setup, you are required to specify what table in EAM you want to use to trigger your e-mail message. To send a PO automatically to a supplier when the PO is approved, select or enter the table r5orders.

Next, enter or select the template you created earlier, and check the Update checkbox. Lastly, enter or select a From Status as well as the To Status. It would be a good idea to use from status of Unfinished and to status of Approved. Save the record and then continue on to the most important part.


Select the record and click on the Actions button. Choose Create Parameters. Now comes a point of discovery. Enter 1 for the first parameter. This corresponds the 1 you entered as the e-mail recipient on your E-mail Template. You and I both know that when you go looking for a Column in the next field under parameter details you’re not going to find anything for the e-mail address of the supplier you want this notification to go to. The fact is, that all of the columns you see when you hit the look up begin with ORD which means you can only select columns of the table r5orders. You really don’t have an option other than to use a user defined field.Select one of the thirty ORD_UDFCHAR fields. Once you’re finished here you’ll need to go to the Purchase Order screen and use screen designer to move the user defined field you chose to somewhere easy to get to, and relabel it “Supplier E-Mail Address” or something to that effect.

Enter 2 for the second parameter, and select ORD_CODE for the column. In the field Report Parameter Line Number you MUST enter the parameter that the report PZORDF uses that corresponds to ORD_CODE. If you go to Administration | Setup | Reports and query for PZORDF you’ll find the canned Print PO report. Click on the Parameters tab and find the parameter SEL_ORDER. The parameter line for this value is what you want to specify in your field for Report Parameter Line Number.Enter 15 for the nest parameter and in the column field enter :MP5USER. This is the user currently logged on. These are the requirements to make the report send with the e-mail notification. Use the other parameters for whatever information you want to include in the body of the e-mail.

Useful Tip:

It would be a good idea to create a condition on your e-mail notification setup for the user defined field to say that it is not empty. That way if someone forgets to enter an e-mail address in your user defined field the e-mail notification won’t fire with nowhere to go.With flex we could auto-populate the user defined field with the e-mail address of the supplier contact. You could also use a user defined checkbox and a condition to give the user the power to check the checkbox to confirm that he wants the PO to send via e-mail. There’s a lot you can do with Hexagon EAM.