Re: Email Personalisation - Bad Data

SanfordWhiteman
Level 10 - Community Moderator

Re: Email Personalisation - Bad Data

Yep.

Frank_Breen2
Level 10

Re: Email Personalisation - Bad Data

Colin, here's a great article that might help you: A Few More Email Scripting Examples.

Nicholas_Manojl
Level 9

Re: Email Personalisation - Bad Data

You would probably be better off having a weekly review of your data in Excel, or setting up some sort of QA process for new leads.

I don't think there is much of a shortcut.

Scripting isn't great because there is just too much variation. For example, you need to write a relatively complex script for the odd cases someone has a double barrel first name - otherwise you'll say "Dear John paul". Similarly, you wouldn't want to do this sort of thing with their last name, because you'll send an email to Maria Von Trapp, instead of Maria von Trapp.

You also can't mix scripting with a dynamic email, so whatever gain you make in personalisation you've lost a limb anyhow. The email scripting also only renders at send time - it can't be inserted into a campaign flow. So whilst you could write a script that checks the length of the first name in seconds, you would still need to check it is working correctly. But here is an example anyhow:

#if (${lead.FirstName.length()} == '0') //or maybe less than 2 for your purposes

#set ($firstname = "there")

Hi $firstname

#else

#set ($firstname = ${lead.FirstName.toLowerCase()})

$display.capitalize($firstname)

#end

I have forgotten his name (he is on this forum), but you could ask the guy at Bright Hooks to write you a fancy webhook that might take care of some of your common issues - his demo stuff is good but I haven't used him professionally. That would have the advantage of fixing your data.

Personally, if I was a CEO, and I'm not, I'd ditch paying for any sort of premium support and instead hire a junior to do QA on all my new leads. 

SanfordWhiteman
Level 10 - Community Moderator

Re: Email Personalisation - Bad Data

You also can't mix scripting with a dynamic email

Ah, but you can.  Watch my blog.  (Hint: Text {{my.tokens}} actually evaluate in a Velocity context, though this order of operations is not documented.)

[A webhook] would have the advantage of fixing your data.

A simple FlowBoost script to do this:

var firstName = {{Lead.FirstName}}.replace(/(\w)(\w*)/g, function(match,$1,$2){

  return $1.toUpperCase() + $2.toLowerCase();

});

Personally, if I was a CEO, and I'm not, I'd ditch paying for any sort of premium support and instead hire a junior to do QA on all my new leads.

I approve of this message.