\$type fsfile [IIF]

Designate Infobox to create FS File

\$type fsfile [queueno [delayseconds]]

This command identifies the infobox as one that, when selected, causes an FS file to be created. The remainder of the infobox file should consist in the main of FS file commands, together with optional infobox commands such as \$next_box to control the logic flow. This infobox type is used for creating FS files for special purposes and it is not necessary to use it for normal callback fax-on-demand applications.  All commands which are not valid IIF commands will be copied to the FS file, and their validity for an FS file is not checked until the FS file is processed.

 Do not perform validation in this type of infobox.  All validation should be done in advance, because once you transfer control to a \$type fsfile infobox, an FS file will be written, even if you fail to add all the necessary commands to it, or if you decide you no longer want to write it.

The parameters on this command are used as follows:

 queueno the TOSEND queue number if required. If omitted the FS will be written to TOSEND.
 delayseconds the time value by which the FS file timestamp is to be pushed forward to delay its pickup. Note that it is unnecessary also to specify \$fax_next_date and \$fax_next_time commands.

The \$var_def_copy command can be used to place \$var_def commands in the generated FS file corresponding to all current user variables.

Variables in the FS file commands are expanded as the infobox is processed. To have variables expanded instead at the time the FS file is processed, double-up the @ sign (or the ` for e-mail commands). The FS number and pathname of the generated FS file can be obtained from system variables INFOBOX_FS_FSNUM and INFOBOX_FS_FILENAME.  Variables expanded into double-quoted strings in the generated FS file will have any embedded double-quotes automatically doubled-up to maintain correct syntax.

Conditional commands (for example, \$if) are actioned at the time the infobox is processed. To have conditional commands actioned instead at the time the FS file is processed, double up the \$ (for example, \$\$if).  Note that variables on commands such as \$\$if may either be processed immediately or in the generated FS file, following the rules in the preceding paragraph.

If you need to send an e-mail to multiple recipients, you will need multiple chained infoboxes, each causing one FS file to be created.

If no \$fax_user command is supplied in the FS file commands, one is added containing the name of the current user profile. Commands \$fax_request_date and \$fax_request_time are always added and do not need to be supplied.

If you are writing an FS file for use in a fax or voice operation, you should consider 'cleaning' the number used on a \$fax_phone or \$voice_phone command using the \$clean keyword for \$set_var, to ensure that it only contains numeric digits.

Examples:

Send a confirmation e-mail after a fax transmission:

; file confirm.IIF

\$type fs

\$next_box s191 ; required: s191 = IIF_PROC_COMPLETE

\$email_esender CopiaFacts@copia.com

\$email_subject "Fax transmission result"

\$if @OC_CLASS = S

\$email_text "Your fax to `routeto was sent successfully"

\$else

\$email_text "Your fax to `routeto failed (`OC_CLASS)"

\$endif

Forward an incoming fax as a PDF e-mail attachment:

; POSTREC1.IIF

;

; This infobox demonstrates post-receive processing

; used to forward by e-mail an incoming fax. It

; requires CopiaFacts version 7 or above. To implement

; this feature, add \$script_locn commands to the USR file

; controlling the incoming fax operation which will

; enable this infobox to be found. Then add a

; command:

;

;

; to the mailbox (MBX) file in which the fax is received.

; note that only successful reception will cause the

; infobox to be processed.

;

; The document is to be converted to PDF for e-mail.

\$type FSFILE

\$next_box s191 ; required: s191 = IIF_PROC_COMPLETE

; the following are FS file commands, now in the IIF

\$fax_user @@FFUSER\email.usr

\$email_esender CopiaFacts@copia.com

\$email_address tim@copia.com ; or use `varname (from USR file)

\$email_text "This document was received on `DATE6 at `TIME2"

\$email_attach "`PR_FAXPATH" "application/pdf; name=""`PR_FAXPDF"""

Forward an incoming fax as a PDF e-mail attachment, with a note when reception failed:

; POSTRECX.IIF

;

; This infobox demonstrates post-receive processing

; used to forward by e-mail an incoming fax. It

; requires CopiaFacts version 7 or above. To implement

; this feature, add \$script_locn commands to the USR file

; controlling the incoming fax operation which will

; enable this infobox to be found. Then add a

; command:

;

; \$post_receive POSTRECX infoboxall  ; include failures

;

; to the mailbox (MBX) file in which the fax is received.

; The document is to be converted to PDF for e-mail.

\$type FSFILE

\$next_box s191 ; required: s191 = IIF_PROC_COMPLETE

; the following are FS file commands, now in the IIF

\$fax_user @@FFUSER\email.usr

\$email_esender CopiaFacts@copia.com

\$email_address tim@copia.com ; or use `varname (from USR file)

\$ife @PR_FAXPATH 8   ; received TIF exists and more than 8 bytes

\$email_text "This document was received on `DATE6 at `TIME2"

\$email_attach "`PR_FAXPATH" "application/pdf; name=""`PR_FAXPDF"""

\$else

\$email_text "Fax call on `DATE6 at `TIME2 failed (code `PR_FAXSTAT)"