02 / Evergreen personalization
Because welcome emails don't have to be static.
Betty Crocker — Evergreen Welcome
A welcome email should feel relevant regardless of when someone subscribes. I developed an evergreen template that adapts its content based on the season and the subscriber's registration status.
Using AMPscript, data extension lookups and reusable Salesforce Marketing Cloud content blocks, a single template supports multiple personalized experiences without requiring separate seasonal email builds.
The creative also presented some interesting technical challenges, including layered backgrounds, responsive recipe layouts and dark mode considerations.
THE ARCHITECTURE
Same template. Different experience.
The template inserts a seasonal recipe block. Independently, a subscriber lookup checks an anonymous-status flag and selects one of two content blocks. The archived source shows the selection, and the selected registration block's insertion point is missing from the export.
- Path 01
Seasonal content
- Current month
- Season determination
- Seasonal Content Builder block
- Path 02
Subscriber personalization
- Subscriber key
- Anonymous-status lookup
- Conditional content block selection
- Both paths
Reusable welcome email template
THE IMPLEMENTATION
A little logic goes a long way.
Here's how the template picks its content and handles a few of the trickier parts of rendering an email.
Pick a season and include its recipe block
AMPscript reads the current month, maps it to one of four Content Builder blocks and falls back to the spring block. The template inserts the selected block in the recipes section.
Paired excerpts from the campaign source. Block IDs were anonymized, title assignments were omitted and indentation was normalized.
set @winter = "[winter block ID]"
set @spring = "[spring block ID]"
set @summer = "[summer block ID]"
set @fall = "[fall block ID]"
set @default = "[spring block ID]"
Set @month = DatePart(NOW(), 'month')
IF (@month == 12) or (@month == 1) or (@month == 2) then
set @contentBlockID = @winter
ELSEIF (@month == 3) or (@month == 4) or (@month == 5) then
set @contentBlockID = @spring
ELSEIF (@month == 6) or (@month == 7) or (@month == 8) then
set @contentBlockID = @summer
ELSEIF (@month == 9) or (@month == 10) or (@month == 11) then
set @contentBlockID = @fall
ELSE
set @contentBlockID = @default
ENDIF
%%=ContentBlockByID(@contentBlockID)=%%Select a content block based on anonymous status
AMPscript uses the subscriber key to look up the anonymous-status flag. A true result selects the anonymous-audience block. The else branch selects the other block. The archived source shows the assignment.
Shortened from the campaign source. Data extension, field, and fragment variable names were anonymized. Fragment markup was removed and indentation was normalized.
set @anonymousAudienceBlock = "[true-state fragment]"
set @otherAudienceBlock = "[else-state fragment]"
set @lookupValue = AttributeValue("_subscriberkey")
set @anonymousStatus = Lookup("RegistrationData","AnonymousStatus","SubscriberKey", @lookupValue)
IF (@anonymousStatus == True) THEN
set @registrationlayer = @anonymousAudienceBlock
ELSE
set @registrationlayer = @otherAudienceBlock
ENDIFGive Outlook a VML background
The table cell declares a background for clients that support it. Outlook's conditional branch uses a VML rectangle, image fill and text box to layer the same email content over the background.
Paired excerpts from the campaign source. The background URL was redacted and the inner tables were omitted.
<td align="center" background="[background image URL]" style="background: url('[background image URL]'); background-size:contain; background-position:center;">
<!--[if gte mso 9]>
<v:rect xmlns_v="urn:schemas-microsoft-com:vml" fill="true" stroke="false" style="width:600px; background-color:#FFFFFF;">
<v:fill type="frame" src="[background image URL]" />
<v:textbox style="mso-fit-shape-to-text:true" inset="0,0,0,0">
<![endif]-->
<!-- Inner email tables omitted -->
<!--[if gte mso 9]>
</v:textbox>
</v:rect>
<![endif]-->
</td>Handle dark mode in Gmail and Outlook
The template declares a light color scheme, targets Gmail with a blend-mode rule and supplies a separate text-fill rule for Outlook. Each technique applies where the client supports it.
Paired excerpts from the campaign source. Unrelated metadata and styles were omitted.
<meta name="color-scheme" content="light">
<meta name="supported-color-schemes" content="light">
<style type="text/css">
u + .body .gmail-blend-difference { background:#FFF; mix-blend-mode:difference; }
</style>
<!--[if (gte mso 9)|(IE)]>
<style type="text/css">
.keep-dark {
mso-style-textfill-type:gradient;
mso-style-textfill-fill-gradientfill-stoplist:"0 \#000000 1 100000\,99000 \#000000 1 100000";
color:#FFFFFF !important;
}
</style>
<![endif]-->
