Kourier Integrator Online Help

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, displays the 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