First Name & Dynamic Data

Wouldn't it be cool if you could add personalized data into a Drip email, like someone's first name?

How much better could people engage with your messages when they feel it was made just for them?

Stop dreaming about it. We can do it!

By the end of this article you'll know what the code below means and how to use it properly.
{{ subscriber.name | split: " " | first | downcase | capitalize }}

You a Visual Learner?

Click to watch the video!

How do I add a First Name?

Opt-In Form

It begins with collecting it on your opt-in form. Along with getting an email, ask for a name!

You'd be surprised at how many people don't think twice about providing this.

Email Message

Now you've got a name and we can include it within your email.

In the email editor click "Personalize" and scroll down until you see the "Custom Fields" portion.

Click insert next to the field you're using for "name" or "first name".

Some code like this will get added to your email:

{{ subscriber.name }}

It's not always perfect

People enter their name weird, it happens.

You ask for just a first name, they give you the full name.

People don't capitalize, so you get "jane smith".

Some like to yell, so you get "JOHN SMITH".

Easy fix in Drip

You might think people entering their name oddly is a problem. 

Well, it is, but Drip let's us fix it really simply.

Using the code below we can tweak and adjust the data so we're addressing people the right way—every. single. time.

{{ subscriber.name | split: " " | first | downcase | capitalize }}

What the heck does that mean!?

I know, I know. It looks confusing. Let me explain...

We're telling Drip to perform some actions to the custom field of "name". This will show "Jane" in our email  instead of "JANE" or "jane" when we send that person a message.

I'll break it down.

In this example we'll pretend the subscriber gave us their name as "JANE SMITH".

subscriber.name

Uses the data we have saved for the subscriber. Our example is "JANE SMITH".

split: " "

If someone enters their full name, like "JANE SMITH" we split the data into parts.

The character we use to split is what's placed in-between the quotation marks.

For our purposes, it is a space. So we're splitting "JANE SMITH" into "JANE" and "SMITH"

For a different reference, let's say we used split: "n" instead. In this case we'd get "JA" and "NE SMITH" as our data. This is because we're splitting on "n" instead of the space.

first

Once we split the data we are taking only the first portion of it.

downcase

This will turn any capitalized letters into lowercase. Remember, our example gave us their name as "JANE SMITH".

Using downcase (plus the previous split and first) will turn that into "jane".

capitalize

Takes the first letter of the data you have and capitalizes it. 

Since we have "jane" that will now become "Jane".

Ta-da!

Now you're a pro and know how to always address people properly in your email message.

Watch the video to see this in action