KMK.FMTMAIL


Declaration

SUBROUTINE KMK.FMTMAIL(f.dict,id,rec,parms,width,etid,message,error_flag,error_message)

Description

This subroutine formats an email message. 

Input Interface

f.dict

File pointer to where dictionaries reside.

id

Item-id of current data record (needed for substitutions).

rec

The current data record (needed for substitutions).

parms

Dynamic substitution parameters value-mark delimited.

width

Width of the output.

etid

Item-id of KT_EMAIL_TEMPLATE item or null.

message

Undefined if ETID is non-null otherwise contains the contents of the message in standard DW substitution format.

error_flag

Undefined.

error_message

Undefined.

Output Interface

f.dict

Unchanged.

id

Unchanged.

rec

Unchanged.

parms

Unchanged.

width

Unchanged.

etid

Unchanged.

message

Contains the email message with substitutions performed.
Each line is attribute delimited.

error_flag

If non-null, message number to issue.

error_message

Parameters required by the message.

 

Example

BASIC
1
  1. CALL HW.OPEN('DICT CUSTOMER',FD.CUST,OFLAG,1)
  2. CALL HW.OPEN('CUSTOMER',F.CUST,OFLAG,1)
  3. ID = '1000'
  4. READ CUST FROM F.CUST, ID ELSE STOP
  5. PARMS = ''  ;* No Program Values
  6. WIDTH = ''  ;* Use Default Width
  7. ETID = 'MSO-001'  ;* Email Template ID
  8. CALL KMK.FMTMAIL(FD.CUST,ID,CUST,PARMS,WIDTH,ETID,MSG,ERRNO,ERRMSG)
  9. IF ERRNO THEN PRINT ERRMSG