This section shows a way to Email with an extra attachment via a command call on the IBM i platform.
The extra attachment can be defined via the FILE1-FILE10 parameters on the NG2CMD command. These attachments are as default named file_1 to file_10, but can be renamed with the rename attachment component as shown below.
In this case this workflow has been setup:
Overview:
The workflow above can be called with this CL program:
PGM
DSPJOBLOG OUTPUT(*PRINT)
IFORMNG2/NG2CMD COMMAND(EMAIL) FILE(QPJOBLOG) +
SPLNBR(*LAST) +
FILE1('/apf3812home/view/kse.pdf') +
ATTACHNAME(JOBLOG.PDF) MAILSERVER(GMAIL) +
SUBJECT('This is my email') +
MAILFROM('customremail@gmail.com') +
MAILTO('customremail@gmail.com')
ENDPGM
Some of the email settings in the workflow are fixed and some are variable and specified on the command. You can setup your own rules. In this example an input spooled file is merged with the fixed template, generic.ift and is sent with a variable subject and variable attachment name to and from email addresses, that are specified on the command.