Submitted by Kim Egekjaer on Tue, 11/30/2010 - 00:00
Forums

The e-mail finishing definition is a very advanced way of distributing e-mails and faxes and I actually suspect, that it can do more than you know, so I would like to give you a couple of hints and tips of how to make the most of it.

A few days ago someone wrote to me and asked for my help as he had a problem: The e-mail address for each document was only found on the first page of the document and unfortunately this caused only the first page of each document to be e-mailed. So he asked me to fix this problem.

When I dug deeper into his export I noticed the setup: He wanted to distribute e-mails in 3 languages: Swedish, german and english depending on the language of each recipient. He has created a split definition to first separate the original spooled file  into new spooled files for each language and then he called different finishing definitions depending on the language (as indicated in the form type). I decided to solve his problem, but also to suggest a more simple solution without the need of the split definition.

First of all the problem (regarding the e-mails only contained the first page) was fixed by using the page selection criteria as seen in option '6. Definition recipient-ID':

------------------------------------------------------------------------------
         Update Finish Recipient-ID                                   PRS330D 

Definition name  . . . . :   OEMAIL                                           

Sequence number  . . . . :    30                                              
Description  . . . . . . .   Find mail address (English line 1)                       

Page selection criteria                                                       

                 Print line   Position   Oper  Compare value                  
                       1       72 -  80  EQ    Page    1                      
------------------------------------------------------------------------------

 

Normally you should leave the page selection criteria blank, but if you fill them out, you tell InterForm400 to only look for the variables and keys, when the specified text is found (you can state up to 3 conditions here - all 3 must be true before the page selection criteria is true). If you want to use an alternative position, you add a new sequence line and test that as well: 

------------------------------------------------------------------------------
         Update Finish Recipient-ID                                   PRS330D

Definition name  . . . . :   OEMAIL                                         

Sequence number  . . . . :    35                                            
Description  . . . . . . .   Find mail address (English line 2)                       

Page selection criteria                                                     

                 Print line   Position   Oper  Compare value                
                       2       72 -  80  EQ    Page    1                    
------------------------------------------------------------------------------

 

Now you can even repeat this for each language that is found and then select different text versions depending on the language as below:

------------------------------------------------------------------------------
         Update Finish Recipient-ID                                   PRS330D

Definition name  . . . . :   OEMAIL                                         

Sequence number  . . . . :    60                                            
Description  . . . . . . .   Find mail address (German line 1)                       

Page selection criteria                                                     

                 Print line   Position   Oper  Compare value                
                       1       72 -  80  EQ    Seite   1                    
------------------------------------------------------------------------------

         Update Finish Recipient-ID                                   PRS330D

Definition name  . . . . :   OEMAIL                                          

Sequence number  . . . . :   060                                             
Description  . . . . . . .   Find mail address (German line 1)                       

Enter where to find key(s) and variables in the print.                       
Field       Description          Length   Printline   Position    Prefix     
*MAILADR    Recipient email adr               1           9                  
*NAME       Recipient name         50        10          45                  
*CCADR      CC email adr                                                     
*CCNAME     CC Name                50                                        
*FAXNO      Fax number             25                                        
*TXTVRS     Text version           10                             TEXTDE     
------------------------------------------------------------------------------ 

(TEXTDE selects the german contents of the email text).

Alternatively you can even combine text found in the spooled file with the prefix to build up the right name for the text version, and thereby select the right one. (You define the text versions via option '5. Definition email text / Cover page text').

Early this month another business partner even pointed my attention to the possibility to actually use this method to share the same e-mail finishing definition between several totally different types of spooled files. This might be a good idea, if you e.g. want to share the same table of e-mails (if you find the e-mail/fax numbers 'By key'), but you should take care not to mix up the page selection criterias for the different spooled file types - you could end up sending e-mails to the wrong recipient  or to none, if you do not take care.