Conditional Formatting

Adobe Campaign allows the use of conditional formatting to display different content in the same template. This formatting can be used anywhere in the body of an email and in the subject line field.

The best example of this is in our footers, where Spanish is shown to subscribers of el Nuevo Herald and English is shown for everywhere else.

Syntax

This code looks like JavaScript except that every portion of JS has to be contained within the <% %> tag that Adobe Campaign uses. This can be used on the simplest level just using an if statement followed by a single else statement, or can go as specific as needed with multiple else if statements in between. Usually siteName is the parameter we use to determine conditional formatting.

<% if (siteName == 'site1') { %>
	site1 stuff
<% } else if (siteName == 'site2') { %>
	site2 stuff
<% } else { %>
	all other sites stuff
<% } %>
There are 2 operators we are most likely to use: == for "is equal to" and != for "does not equal."

Sometimes an OR statement might be needed. Set those up like this:

<% if (recipient.siteName == 'site1' || recipient.siteName == 'site2') { %>
	site1 and site2 stuff
<% } else { %>
	all other sites stuff
<% } %>
OVERVIEW

Description

EDS purpose and structure

Instructions

how to use the EDS

Resources

links and information about HTML email

FRAMEWORK

Email Framework

standard email framework

ATOMS

buttons

EDS buttons

colors

EDS color palette

fine print

EDS fine print

h1

EDS H1

h2

EDS H2

h3

EDS H3

h4

EDS H4

links

EDS text links

p

EDS p

small text

EDS small text

spacing

EDS spacing rules

text modifiers

EDS text modifier classes

MODULES

App Module

download our app and app badges

Basic Module

large icon, subheading, body copy and button

LAYOUTS

Columns

how to work with multi-column layouts

Zig-Zag Layout

how to create a zig-zag layout that collapses gracefully on mobile

ADOBE CAMPAIGN

Campaign Shortcodes

shortcodes for Adobe Campaign that import dynamic content or personalization data

Conditional Formatting

how to use if-else formatting to display content

TEMPLATES

Marketing | Content

email template for content marketing

Marketing | Event

email template for event promotion

Marketing | Offer

email template for marketing offer

Newsletter

email template for newsletters