This is an old revision of the document!
[ Up To iMail ]
Email with embedded text is an enhancement to iDocs, supporting the merge of a text overlay with a spool file. Output of the merge processing will be sent as a text email. The following documentation will present details for implementing email with embedded text.
Create a text document to be used as the Front Overlay. This document must be put in the QDLS/FORMFMG shared folder on the iSeries. Ftp or iSeries Navigator can be used.
The '&' fields on this document are to be used as anchors for spool file data (&INVAMOUNT &INVDATE &INVMONTH &INVOICEID).
Any text editor can be used to create this file. The example shown below is Notepad:
Definition of a text overlay is similar to the definition of form overlay. From ‘Define a Form Application’ screen:
From ‘Front Side Overlay’, press F4 to select an overlay, a prompting screen will be displayed:
• You can type a name and press Enter to search an overlay.
• Select option 1 on an overlay to choose it for form definition.
• Select option 5 to view the content of text overlay.
When a text overlay is selected, the ‘Destination Out Queue’ should be *EMAILTEXT or *EMAILTXT. The difference between *EMAILTEXT and *EMAILTXT is:
• *EMAILTEXT : text overlay is merged with spool data and write to body of email message.
• *EMAILTXT : text overlay is merged with spool data and email as an attached .txt file
Note: The text overlay is defined as the Front Side Overlay.
The ‘Destination Out Queue’ field is promptable. F4 will display a popup window where the user can select or search an output queue.
• Name: Load all output queues from a particular library
• *LIBL: Load all output queues from current libraries list.
• *ALL: Load all output queues in system.
• *USRLIBL: Load all output queues from list of user libraries.
Search: search a library from list of libraries depend on the ‘Default library’.
Use Spooled Datamap Field Maintenance to define the map fields as indicated below:
Note that the reserved fields *SUBJECT and *TOADDRESS are used to scrape that information from the spool file. The remaining 4 fields in this example (INVAMOUNT INVDATE INVMONTH INVOICEID) are data mapped fields that are to be used as anchors as seen in the text document EMLTXT.txt shown above (&INVAMOUNT &INVDATE &INVMONTH &INVOICEID).
Merge a text overlay with spool file is similar with normal form overlay. The priority of email address is:
• Look up the email address from data of special fields (*TOADDRESS, *FRADDRESS, *CCADDRESS, *BCADDRESS).
• If the addressed doesn’t come from special fields, it will be looked up from Smart Routing definition.
• Or the addresses will be looked up from the default email address.
• Otherwise, the spool file is ignored.
From ‘Work with Form Applications’ screen, select option 15 on a form:
and press enter to go to the ‘Work with Spooled Files’ screen, the user can select option 1=Merge/Print or 11=Merge/Email to merge and send email.
• When option Merge/Print is selected, an ‘Output option’ screen is prompted:
The value of field Outq should be *FORMDEF if the user has specified *EMAILTEXT for the ‘Destination output queue’ at the form definition.
• When option Merge/Email is selected, the screen ‘Output options’ will not be displayed, and the *EMAILTEXT is used as the Destination output queue if the overlay of form is text. And a prompt window will be display for confirmation by the user before email is sent. The user can change email information at this screen, and press enter to email or F12 to cancel sending.
This example generated the following email message:
From: ANH@INFORMDECISIONS.COM [mailto:ANH@INFORMDECISIONS.COM] Sent: Wed 6/23/2010 2:21 PM To: Anh Nguyen Subject: This is page #01 - Invoice INV103004 - Address is blank This is a monthly email to notify the payment for 01 will be sent on 04/30/10. Invoice ID: INV103004 - Amount: 145.34 [Text Email testing purpose only] Thanks. inForm Decisions
Note: The prompting for confirmation will only work in the interactive mode and will be disabled when the merge is processed by an Engine or running in a batch job.