Kourier Integrator User Guide

General Reference > Command Reference > KMK.FMTMAIL

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

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

Related Topics: 

KMK.SENDMAIL

Creating Custom Email Messages

E-mail Templates

Test E-Mail Interface

Kourier TCL Commands Overview