>> Home > M5 Mailer: Take the Bulk out of email blasts Mailer Home | My Mach5 | Download | Support | Buy Mailer  
 
Online Manual

Welcome
Setup
Overview
Composing Details
Merge Info Details  
Formatted Email  
HTML Importing  
Varying Content  
Selecting Records  
Attachments  
Managing Data
List Management
Scripting
Scheduling
More Help

Mailer Home


Untitled Document

Explore M5 Mailer

Take the bulk out of email! TM

Use your own data
Personal email merge
Send individual email
HTML and/or text
Handy email templates


Explore M5 Subscriber

Web-based list management made simple!

Simple subscribe tool
Opt-in confirmed
Track reads and clicks
Custom matching look
Free for up to
        5000 contacts

 

Mach5 Mailer Help Docs -- IF Statements

IF Statements - Different Emails to Different People

Use conditional statements to send different email content to different recipients. To use it, click the "Insert IF block" button or choose ‘Insert IF ’ command under the Mail menu. This will bring up the Insert If helper, which will guide you through the process of creating the IF statement.

In the ‘Field Name’ drop-down box, select the field name in the database field you will be comparing to. In the ‘Comparison’ drop-down box, select the comparison you will be using. Then, in the ‘Compare To’ field, type the text you will be comparing the field name to. If you would like for your search to be case-sensitive, then check ‘Case sensitive’. This means that a search for ‘MARK’ will not return ‘mark’.

Then, type the text or choose the field name to insert if the above condition is true. In the text field, you can also include a field name, surrounded with brackets like [this].

Here is a relatively simple IF statement:

<%IF [Country] = "USA" THEN %>You're an American<% ELSE %>You're not an American <% END IF %>

This does a case-insensitive equality comparison of the field ‘Country’ with the text USA, substituting "You’re an American" if ‘Country’ does equal ‘USA’ and substituting "You’re not an American" if ‘Country’ does not equal ‘USA’.

This is the same comparison, but if the comparison is not true, the country is displayed. The IF generator does not facilitate generation of complex statements such as these, so it is recommended that you create the basic structure with the IF generator and make the custom modifications in the editor.

The goal of the following code is to correctly display a multi-line address; if there is no second address line, this if statement will not display it.

[First Name] [Last Name]

[Address1]

<%IF NOT ISEMPTY [Address2] THEN %>[Address2]<% END IF %>

[City], [State] [Zip Code]

<%IF [Country] != "USA" THEN %>[Country] <%END IF%>

The IF statements in Mailer are highlighted in blue to make them easier to read. The first IF checks and sees the [Address2] field is not blank. If it is not blank, then both the [Address1] and the [Address 2] fields are inserted.

The second IF simply does not print the [Country] field if it equals ‘USA’.

You can place IF statements anywhere: inside of other IF statements, inside of file attachment blocks, even in the message headers (the Subject, From, and Reply-to fields).

Operators and Syntax

Equality exp = exp
Not Equals

exp != exp

Less than, greater than, etc. <, <=, =>, > as in exp < exp
Substring exp CONTAINS exp
Empty test ISEMPTY exp
Case Sensitive put CASEYES at the beginning
as in CASEYES exp CONTAINS exp
Negation

put NOT before expression
but after CASESYS if needed.

<%IF if-expression THEN %>output<%END IF%>

<%IF if-expression THEN %>output1<% ELSE %>output2<% END IF %>

Note that hard returns in your mailing inside of a conditional will get output to the mailing. So be careful where you place your carriage returns. You can put whitespace in a line if you need to like this:

<%IF if-expression THEN
%>output1<%
ELSE
%>output2<%
END IF %>

Home   |   Site map   |   Analyzer   |   Mailer   |   PopMonger   |   Resources   |   Customers and Partners  |   Contact
Mach5 is a registered trademark of Mach5 Development.