Siebel Marketing User Guide > Creating and Using Offers > Working with Email Offers >

If-Then-Else Personalization Element


The following is a list of If-Then-Else personalization element components:

  • $(if [Field: FieldName]). The If component is required to start an If-Then-Else personalization element. It determines if the merge field named [FieldName] has a value. If there is a value for [FieldName], the text between this If-Then-Else component and the next If-Then-Else component is not removed from the email.
  • $(elseif [Field: FieldName]). The Else-If component is the same as the If component, except that it is used after the start of the If-Then-Else personalization element.
  • $(else). The Else component is used after a $(if) or $(elseif) component. When an analysis of a preceding $(if) or $(elseif) component results in the preceding block of text or HTML being removed from the outgoing email, the $(else) component's block of text or HTML is not removed from the outgoing email. If the preceding $(if) or $(elseif) component does not remove its block of text or HTML, the $(else) component removes its block of text or HTML.
  • $(endif). The End-If component closes the current If-Then-Else personalization element.

The following is a simple example of the use of an If-Then-Else personalization element. If the first name is defined, the contact's or prospect's first and last name appears. If the first name is not defined, only the last name appears:

$(if [Field: First Name])

Dear [Field: First Name] [Field: Last Name],

$(else)

Dear Mr. or Mrs. [Field: Last Name],

$(endif)

Nesting If-Then-Else personalization elements (placing one within another) is an acceptable practice. The following is an example of nesting these elements:

$(if [Field: First Name])

$(if [Field: Last Name])

Dear [Field: First Name] [Field: Last Name],

$(else)

Dear [Field: First Name],

$(endif)

$(elseif [Field: Last Name])

Dear Mr. or Mrs. [Field: Last Name],

$(else)

To Whom It May Concern:

$(endif)

Using of indentation indicates the nesting of one If-Then-Else personalization element within another. This is not necessary, but makes it easier to read. Also, notice that each component is on its own line. This use of separate lines is also not necessary, but makes reading the offer easier.

After the Email Marketing Server makes the decision about what text or HTML to remove, the If-Then-Else personalization element components are also removed (including their trailing line breaks).

Siebel Marketing User Guide