How to add an IF statement to a AutoMail template

Introduction

IRIS AutoMail uses the interface of Microsoft Word to generate correspondence. To create bespoke AutoMail templates you will require knowledge of Microsoft Word to the level of complexity that your bespoke template requires.

This topic explains what an 'IF statement' is and how to use it.

 

An IF statement is a conditional statement that contains the keyword IF, followed by an expression in the condition, the action that needs to be carried out once the results have been derived, and an option to add an alternative action.

It is possible to insert text subject to evaluation of a condition within the template code. For example, different paragraphs of text could be printed on the same letter depending on whether the client is a business or a personal client. The main tool in creating conditional text is the IF statement.

Many IRIS templates use IF Statements. For example, his/her can be inserted in a document when writing to a client that is Male/Female. You would like it addressed to Madam/ Sir instead of a Formal/Informal salutation.

 

Creating a IF statement

This example shows how to add an IF statement for the IRIS tag 'Is Female', and how to insert the relevant text if the client is Female or Male:

  1. From the IRIS Main Menu, click IRIS AutoMail.

  2. The AutoMail - Letter Request Browser displays. Click Templates.

  3. The AutoMail - Letter Template Maintenance screen displays. Highlight a template and click Edit to edit the template.

The template will then be displayed.

  1. Toggle on the Field codes (press ALT + F9 ). For information on how to turn on field codes in MS Word please refer to KB IAS-119390.

  2. Left-click on the document where you would like to enter the IF statement. For this example, it would be next to the word 'Dear'.

  3. Minimize Word, the tag selection screen displays.

  4. Open the folder the Particular Client | Individual | select Female.

  5. Click Refresh.

  6. Maximise Word. (You are now ready to enter the tag in the document)
  7. To check for versions of Word, Click on Help | About when in a Word Document.

 

For Versions of MS Word 2007 or later:

  1. Click the Mailings tab | In the Write & Insert Fields section, click the Rules down arrow.

  2. Select "IF...Then...Else..."

The Insert Word Field : IF screen displays.

  1. In the field name, click the down arrow and select LMCLISFemale

  2. In the Comparison field, select Equal to.

  3. In the Compare to field enter 1 (1=True (Yes), 0=False (No)

  4. In the Insert this text field, enter the word "Madam".

  5. In the Otherwise insert this text field , enter the word "Sir".

  6. Click OK.

This then enters the IF statement in the template, which will be displayed as:

 {IF {MERGEFIELD LMCLIsFemale} = 1 "Madam" "Sir"}

  1. Minimize Word and click Save in the Tag selection screen.

 



Related topics

How to set custom AutoMail templates

What Microsoft Word skills may I need to edit AutoMail templates

How to change the date format in AutoMail

How to change the date format of an IRIS tag in AutoMail

Tax refund does not show in the tax return cover