Docs

Hey Soul Sister Chords

C / G / Am / F

Hey-ay
Hey-ay-ay-ay
Hey-ay-ay-ay

Your lipstick stains
On the front lobe of my left side brains
I knew I wouldn’t forget you
And so I went and let you blow my mind

Your sweet moonbeam
The smell of you in every single dream I dream
I knew when we collided you’re the one I have decided
Who’s one of my kind

Hey, soul sister
Ain’t that Mr. Mister on the radio
Stereo, the way you move ain’t fair you know

Hey, soul sister
I don’t want to miss a single thing you do-ooo
Tonight

Hey-ay
Hey-ay-ay-ay
Hey-ay-ay-ay

Just in time
I’m so glad you have a one track mind like me
You gave my life direction
A game show love connection
We can’t deny-eye-eye-eye-eye-eye-eye

I’m so obsessed
My heart is bound to beat right out my untrimmed chest
I believe in you, like a virgin you’re Madonna
And I’m always gonna wanna blow your mind

Hey, soul sister
Ain’t that Mr. Mister on the radio
Stereo, the way you move ain’t fair you know

Hey, soul sister
I don’t want to miss a single thing you do-ooo
Tonight

The way you can cut a rug
Watching you’s the only drug I need
So gangster, I’m so thug
You’re the only one I’m dreaming of you see
I can be myself now finally in fact there’s nothing I can’t be
I want the world to see you be
With me

Hey, soul sister
Ain’t that Mr. Mister on the radio
Stereo, the way you move ain’t fair you know

Hey, soul sister
I don’t want to miss a single thing you do to night

Hey, soul sister
I don’t want to miss a single thing you do-ooo
Tonight

Hey-ay
Hey-ay-ay-ay
Hey-ay-ay-ay

Tonight

Hey-ay
Hey-ay-ay-ay
Hey-ay-ay-ay

Tonight

Ranch Dressing Recipe

Total time: 5 minutes
Prep time: 5 minutes
Cook time: 0

Ingredients:
mayonnaise
olive oil
dijon mustard
1 clove of garlic, grated
worcestershire sauce
hot sauce
parmesan cheese, grated
parsley, chopped
salt

Method:
Whisk together mayonnaise and dijon mustard then drizzle olive oil, whisk to emulsify.
Combine garlic clove, add worcestershire sauce, hot sauce, parmesan, parsley with the oil concoction. Whisk all ingredients together and add salt to taste.

SFMC (ExactTarget) AMPscript Snippets

We use these all the time!

Pull in a date

Current Year
%%=Format(Now(), "yyyy")=%%

Date that will update continually
%%=Format(Now(), "MM/dd/yyyy")=%%

Date that is hard set from time of send
%%=Format(Now(true), "MM/dd/yyyy")=%%

Date plus days
%%=Format(DateAdd(Now(true), "14", "D"), "MM/dd/yyyy")=%%

Casing

%%=ProperCase(variable)=%%
%%=UpperCase(variable)=%%
%%=LowerCase(variable)=%%

URLs

URL from list
href="%%=RedirectTo(variable)=%%"

Variable as URL parameter
href="https://camiah.com/?param=%%variable%%"

Variable as part of the URL
%%[
set @url = concat("https://camiah.com/",variable)
]%%
href="%%=RedirectTo(@url)=%%"

Remove tracking from a URL
href="%%=concat('link you do NOT want to track')=%%"

Tracking Pixel

<custom name="opencounter" type="tracking">

System level variables

view online = %%view_email_url%%
email address = %%emailaddr%%
name of campaign = %%emailName_%%
forward to a friend = %%ftaf_url%%
unsubscribe = %%unsub_center_url%%
profile center = %%profile_center_url%%
subscription center = %%subscription_center_url%%
sender reply name = %%replyname%%
sender reply email address = %%replyemailaddress%%
business name = %%Member_Busname%%
business address = %%Member_Addr%%
business city = %%Member_City%%
business state = %%Member_State%%
business postal code = %%Member_PostalCode%%
business country = %%Member_Country%%

Subjectline and Preheader

In Properties
Subject: %%=v(@subjectline)=%%
Preheader: %%=v(@preheader)=%%

Between </style> and </head>
%%[
set @firstname = ProperCase(firstname)

/Is there a First Name in the Subjectline? Y or N/
set @has_firstname = "N"

if empty(firstname) or @has_firstname == "N" then
  set @subjectline = "replace"
else
  set @subjectline = concat(@firstname,", replace")
endif

/Is there a Preheader? Y or N/
set @has_preheader = "Y"

if @has_preheader == "Y" then
  set @preheader = "replace"
endif
]%%

Proofing info in Subjectline

%%[
if _DataSourceName == "DE_Name" then
  set @subjectline = concat("[Proofing Info] ",@subjectline)
endif
]%%

Space in Field Header Name

%%[
set @firstname = [First Name]
]%%

Hiding content on web

%%[if _messagecontext != "vawp" then]%%
content hidden on web
%%[endif]%%

Hiding content on forward to a friend

%%[if _messagecontext != "ftaf" then]%%
content hidden on forward to a friend
%%[endif]%%

Formatting

Date
%%=Format(variable, "MMMM d, yyyy")=%%
%%=Format(variable, "MM/dd/yy")=%%

Time
%%=Format(variable, "h:mm tt")=%%

Phone number
%%=Format(variable,"###-###-####")=%%

Currency
%%=Format(variable,"$#,0.00;-$#,0.00")=%%

FormatCurrency

United States
%%=FormatCurrency(@productPrice,"en-US",2,"$")=%%
Great Britain
%%=FormatCurrency(@productPrice,"en-GB",2,"£")=%%
Norway
%%=FormatCurrency(@productPrice,"nb-NO",2,"kr")=%%
France
%%=FormatCurrency(@productPrice,"fr-FR",2,"€")=%%
Switzerland
%%=FormatCurrency(@productPrice,"de-CH",2,"CHF")=%%
Belgium
%%=FormatCurrency(@productPrice,"fr-BE",2,"€")=%%
Germany
%%=FormatCurrency(@productPrice,"de-DE",2,"€")=%%
Austria
%%=FormatCurrency(@productPrice,"de-AT",2,"€")=%%
Netherlands
%%=FormatCurrency(@productPrice,"nl-NL",2,"€")=%%
Denmark
%%=FormatCurrency(@productPrice,"da-DK",2,"DKK")=%%
Finland
%%=FormatCurrency(@productPrice,"fi-FI",2,"€")=%%
Sweden
%%=FormatCurrency(@productPrice,"sv-SE",2,"kr")=%%
Australia
%%=FormatCurrency(@productPrice,"en-AU",2,"$")=%%

Expire a Coupon

%%[
set @expires = "12/31/17"
set @date = Now()
set @days = DateDiff(@date, @expires, "D")
]%%

%%[if @days >= 0 then]%%
Coupon
%%[else]%%
Coupon has expired
%%[endif]%%

Pull in a Content Area

Classic Builder
%%=ContentArea("UniqueID")=%%

Content Builder
%%=ContentBlockbyID("UniqueID")=%%

Drag and Drop Content Slot

Classic Builder
<custom type="content" name="Name of Content Block">

Content Builder
<div data-type="slot" data-allowed-blocks="" data-max-blocks="" data-label="Name of Content Block" data-key="Unique Key ID"></div>

Raise Error

%%[else RaiseError("Write Error Sentence Here", true) endif]%%

Find content in a string

%%[if IndexOf(variable,"this") > 0 then
Write set Statement Here
endif]%%

Replace content in a string

%%[set @variable = Replace(variable,"old","new")]%%

Micro base URL

%%microsite_base_url[default]UniqueID[/default]%%

Target a specific domain

%%[if domain(emailaddr) == "domain.com" then]%%

Lookup Table

%%[
set @fieldData = fieldData
set @variable = Lookup("lookupTableName","fieldHeaderForVariable","matchbackVariable",@fieldData)
]%%

Lookup Table with Row Count

%%[
set @rows = LookupRows("lookupTableName","matchbackVariable",matchbackVariable)
if RowCount(@rows) > 0 then
  set @row = Row(@rows,1)
  set @variable1 = Field(@row,"fieldHeaderForVariable1")
  set @variable2 = Field(@row,"fieldHeaderForVariable2")
endif
]%%

AMPscript Looping Tips

Use the Lookup Table AMPscript in the body, wrapped around your content you want looping.

We suggest looping full stacked <tables> or full stacked <tr>s.

Call variables using %%=v(@variable)=%% in the body.

Loop with Sendable List matching to Lookup Table

Sendable List or Data Extension
emailAddress matchbackVariable
this@emailaddress.com 0239485
that@emailaddress.com 7462829
theother@emailaddress.com 0239485
Lookup Table (Data Extension)
matchbackVariable fieldHeaderForVariable1 fieldHeaderForVariable2
7462829 Tacos Mardi Gras
0239485 Spaceships Spain
0239485 Spinach Alfredo The Bathroom
0239485 Radios The Beastie Boys Recording Studio
%%[ set @rows = LookupRows("lookupTableName","matchbackVariable",matchbackVariable) for @i = 1 to rowCount(@rows) do set @row = Row(@rows,1) set @variable1 = Field(@row,"fieldHeaderForVariable1") set @variable2 = Field(@row,"fieldHeaderForVariable2") ]%% <table cellpadding="0" cellspacing="0" border="0" width="100%"> <tr> <td align="left" valign="top"> (CONTENT TO BE LOOPED) I love when camiah sends me %%=v(@variable1)=%% from %%=v(@variable2)=%%. </td> </tr> </table> %%[next @i endif]%%

Loop with Lookup Table Only

Lookup Table (Data Extension)
matchbackVariable fieldHeaderForVariable1 fieldHeaderForVariable2
fieldData Tacos Mardi Gras
fieldData Spaceships Spain
fieldData Spinach Alfredo The Bathroom
%%[ set @matchbackVariable = "fieldData" set @rows = LookupRows("lookupTableName","matchbackVariable",@matchbackVariable) for @i = 1 to rowCount(@rows) do set @row = Row(@rows,1) set @variable1 = Field(@row,"fieldHeaderForVariable1") set @variable2 = Field(@row,"fieldHeaderForVariable2") ]%% <table cellpadding="0" cellspacing="0" border="0" width="100%"> <tr> <td align="left" valign="top"> (CONTENT TO BE LOOPED) I love when camiah sends me %%=v(@variable1)=%% from %%=v(@variable2)=%%. </td> </tr> </table> %%[next @i endif]%%

Loop with a Grouping

%%[
set @rows1 = LookupRows("lookupTableName","matchbackVariable",matchbackVariable)
if RowCount(@rows1) > 0 then
  set @row1 = Row(@rows1,1)
  set @groupingVariable = Field(@row1,"groupingVariable")
endif

set @oneItem = "0"
set @multipleItems = "0"
set @previousItemNumber = ""
set @rows2 = LookupOrderedRows("lookupTableName",0,"groupingVariable ASC","matchbackVariable",matchbackVariable)
for @i = 1 to rowCount(@rows2) do
  set @row2 = Row(@rows2,@i)
  set @groupingVariable = Field(@row2,"groupingVariable")
  set @variable1 = Field(@row2,"fieldHeaderForVariable1")
  set @variable2 = Field(@row2,"fieldHeaderForVariable2")

  set @rows3 = LookupRows("lookupTableName","matchbackVariable",matchbackVariable,"groupingVariable",@groupingVariable)
  set @groupingVariableQuantity = RowCount(@rows3)

  if @groupingVariableQuantity == "1" then
    set @oneItem = "1"
    set @multipleItems = "0"
  elseif @previousItemNumber == @groupingVariable then
    set @oneItem = "0"
    set @multipleItems = add(@multipleItems, 1)
  else
    set @oneItem = "0"
    set @multipleItems = "1"
  endif

  if @oneItem == "1" or @multipleItems == "1" then
]%%
  <table cellpadding="0" cellspacing="0" border="0" width="100%">
    <tr>
      <td align="left" valign="top">
        (CONTENT TO BE LOOPED AND GROUPED)
        I love when camiah sends me %%=v(@variable1)=%% from %%=v(@variable2)=%%.
      </td>
    </tr>
  </table>
%%[
  else
  endif

  set @oneItem = "0"
  set @multipleItems = @multipleItems
  set @previousItemNumber = @groupingVariable

next @i endif
]%%

Mobile Hide and Mobile Show

Mobile Hide

This content will show on desktop and hide on mobile. Always use on a <td>.

<td class="hidden" align="left" valign="top" style="font-family:Helvetica, Arial, sans-serif; font-size:14px; mso-line-height-rule:exactly; line-height:18px; color:#3a3a3a; padding:20px 20px 20px 20px;">CONTENT THAT IS HIDDEN ON MOBILE AND SHOWS ON DESKTOP</td>

css

<style type="text/css">
@media only screen and (max-width: 480px), only screen and (max-device-width: 480px) {
.hidden {
  width: 0 !important;
  display: none !important;
}
}
</style>

Mobile Show

This content will show on mobile and hide on desktop. Use a whole <table> inside this code. This hide will not work when forwarding the email.

<!--[if !mso]><!-->
<div class="show" style="font-size:0; line-height:0; display:none; max-width:0; max-height:0; overflow:hidden;">
 <table cellpadding="0" cellspacing="0" border="0" width="100%">
   <tr>
     <td align="left" valign="top" style="font-family:Helvetica, Arial, sans-serif; font-size:14px; mso-line-height-rule:exactly; line-height:18px; color:#3a3a3a; padding:20px 20px 20px 20px;">CONTENT THAT IS HIDDEN ON DESKTOP AND SHOWS ON MOBILE</td>
   </tr>
 </table>
</div>
<!--<![endif]-->

css

<style type="text/css">
@media only screen and (max-width: 480px), only screen and (max-device-width: 480px) {
.show {
  display: block !important;
  overflow: visible !important;
  max-width: inherit !important;
  max-height: inherit !important;
}
}
</style>

Troubleshooting Aid

Paste this CSS into the head of your code.

<style type="text/css">
* {background-color: rgba(255,0,0,.2);}
* * {background-color: rgba(0,255,0,.2);}
* * * {background-color: rgba(0,0,255,.2);}
* * * * {background-color: rgba(255,0,255,.2);}
* * * * * {background-color: rgba(0,255,255,.2);}
* * * * * * {background-color: rgba(255,255,0,.2);}
</style>

Email Build Checklist
















Box Shadow

<table cellpadding="0" cellspacing="0" border="0" width="100%">
  <tr>
    <td class="boxShadow" align="left" valign="top" style="font-family:Helvetica, Arial, sans-serif; font-size:14px; mso-line-height-rule:exactly; line-height:18px; color:#3a3a3a; padding:20px 20px 20px 20px;">Column 1 Column 1 Column 1 Column 1 Column 1 Column 1 Column 1 Column 1 Column 1 Column 1</td>
  </tr>
</table>

css

<style type="text/css">
.boxShadow {
	-moz-box-shadow:3px 3px 5px rgba(0,0,0,0.3);
	-webkit-box-shadow:3px 3px 5px rgba(0,0,0,0.3);
	box-shadow:3px 3px 5px rgba(0,0,0,0.3);
}
</style>

120 DPI Issue

For Text
Apply width and height attributes to all block level tags like <table> and <td>, then declare a matching CSS width and height property in a style. Do not do this to % based widths.

From this
<table cellpadding="0" cellspacing="0" border="0" width="100%">
  <tr>
    <td width="300" height="120" align="left" valign="top">CONTENT</td>
  </tr>
</table>

To this
<table cellpadding="0" cellspacing="0" border="0" width="100%">
  <tr>
    <td width="300" height="120" align="left" valign="top" style="width:330px; height:120px;">CONTENT</td>
  </tr>
</table>

For Imagery

Replace doctype

From this
<html xmlns="http://www.w3.org/1999/xhtml">

To this
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office">
Add this before closing </head>

<!--[if gte mso 9]><xml>
 <o:OfficeDocumentSettings>
  <o:AllowPNG></o:AllowPNG>
  <o:PixelsPerInch>96</o:PixelsPerInch>
 </o:OfficeDocumentSettings>
</xml><![endif]-->

CSS Circle // Border Radius

<table cellpadding="0" cellspacing="0" border="0">
  <tr>
    <td align="left" valign="top" style="background-color:#FF0004;"><img src="http://placehold.it/100x100" alt="" width="100" height="100" border="0" style="display:block; border-radius:50%;" /></td>
  </tr>
</table>

For a Border Radius with a Border

<table cellpadding="0" cellspacing="0" border="0" style="border-collapse: separate !important;">
  <tr>
    <td width="100" height="100" align="center" valign="middle" style="font-family:Helvetica, Arial, sans-serif; font-size:10px; mso-line-height-rule:exactly; line-height:12px; color:#8b6d49; padding:0 0 0 0; border:1px solid #8b2331; border-radius:50%;">
      EXAMPLE
    </td>
  </tr>
</table>

Web Fonts in Email

Web Safe Fonts

Helvetica, sans-serif;
Arial, sans-serif;
Verdana, sans-serif;
Times New Roman, serif;
Times, serif;
Georgia, serif;

Adding a Web Font to Email

<table cellpadding="0" cellspacing="0" border="0" width="100%">
  <tr>
    <td align="left" valign="top" style="font-family:'Coda', Arial, Helvetica, sans-serif; font-size:12px; mso-line-height-rule:exactly; line-height:20px; color:#58595b; padding:10px 20px 10px 20px;" bgcolor="#ffffff"><strong>Content</strong></td>
  </tr>
</table>

Meta (Place directly above the opening <style> of the css)

<!--[if !mso]><!-->
<link href="https://fonts.googleapis.com/css?family=Coda" rel="stylesheet">
<!--<![endif]-->