Re: Using an email script token in the subject line

Michael_McGowa1
Level 3

Re: Using an email script token in the subject line

Hi Sanford,

Below is the full script token.

With the subject line I am seeing:

image.png

And in the body of the email I am seeing

image.png

##********Finding out if they came through the CoReg
#set ($coReg = ${lead.mktocoreg})
#set ($coReg2Scp = ${lead.mktocoreg2scp})

#if($coReg.equals("niche"))
#set ($coRegMkt = "yes")
#elseif ($coReg.equals("campusreel"))
#set ($coRegMkt = "yes")
#else
#set ($coRegMkt = "no")
#end
##********Finding out if they came through the CoReg and converted or Just Member
#if(($coReg2Scp.equals("")) && ($coRegMkt.equals("yes")))
#set ($scpMember = "Coreg Not a Member")
#elseif (($coReg2Scp.equals("1")) && ($coRegMkt.equals("yes")))
#set ($scpMember = "Coreg but member")
#else 
#set ($scpMember = "Member")
#end

##******************Eligible or Taken Bold**********
#set ($takenBold = ${lead.mktotakenBold})
#set ($eligibleBold = ${lead.mktoeligiblebold})

#if (($eligibleBold.equals("1")) && ($takenBold.equals("")))
#set ($showBold = 25000)
#else
#set ($showBold = 0)
#end

##******************Eligible or Taken Juno**********
#set ($takenJuno = ${lead.mktotakenJuno})
#set ($eligibleJuno = ${lead.mktoeligiblejuno})

#if (($eligibleJuno.equals("1")) && ($takenJuno.equals("")))
#set ($showJuno = 2500)
#else
#set ($showJuno = 0)
#end

##******************Eligible or Taken Niche**********
#set ($takenNiche = ${lead.mktotakenNiche})
#set ($eligibleNiche = ${lead.mktoeligibleniche})

#if (($scpMember.equals("Coreg Not a Member")) && ($coReg.equals("niche")))
#set ($showNiche = 0)
#elseif (($eligibleNiche.equals("")) && ($coReg.equals("campusreel")) && ($takenNiche.equals("")))
#set ($showNiche = 2000)
#elseif (($eligibleNiche.equals("1")) && ($takenNiche.equals("")))
#set ($showNiche = 2000)
#else
#set ($showNiche = 0)
#end

##******************Eligible or Taken Christian Connector**********
#set ($takenCC = ${lead.mktotakenChristianConnector})
#set ($eligibleCC = ${lead.mktoeligiblechristianc})

#if (($eligibleCC.equals("1")) && ($takenCC.equals("")))
#set ($showCC = 2500)
#else
#set ($showCC = 0)
#end

##******************Eligible or Taken Nitro**********
#set ($takenNitro = ${lead.mktotakenNitro})
#set ($eligibleNitro = ${lead.mktoeligiblenitro})

#if (($eligibleNitro.equals("1")) && ($takenNitro.equals("")))
#set ($showNitro = 2000)
#else
#set ($showNitro = 0)
#end

##Adding up the dollars available
#set ($subtotal = $math.add($showNiche, $showBold, $showNitro, $showCC, $showJuno, 13000))

#set ($formattedTotal = $number.format("number", $subtotal))
=?UTF-8?Q?${esc.d}?=${formattedTotal}

 

SanfordWhiteman
Level 10 - Community Moderator

Re: Using an email script token in the subject line

There’s whitespace all throughout that code! Velocity is space-preserving. So all those line breaks end up in the output.

Michael_McGowa1
Level 3

Re: Using an email script token in the subject line

I took away the spaces but now the entire subject line is moving as if there is a tab space before the subject line image.png

Also I am the encoding is still showing up in the body of the email

Michael_McGowa1_0-1658771121345.png

Any suggestions? Here is the updated code.

##********Finding out if they came through the CoReg
#set ($coReg = ${lead.mktocoreg})
#set ($coReg2Scp = ${lead.mktocoreg2scp})
#if($coReg.equals("niche"))
#set ($coRegMkt = "yes")
#elseif ($coReg.equals("campusreel"))
#set ($coRegMkt = "yes")
#else
#set ($coRegMkt = "no")
#end
##********Finding out if they came through the CoReg and converted or Just Member
#if(($coReg2Scp.equals("")) && ($coRegMkt.equals("yes")))
#set ($scpMember = "Coreg Not a Member")
#elseif (($coReg2Scp.equals("1")) && ($coRegMkt.equals("yes")))
#set ($scpMember = "Coreg but member")
#else 
#set ($scpMember = "Member")
#end
##******************Eligible or Taken Bold**********
#set ($takenBold = ${lead.mktotakenBold})
#set ($eligibleBold = ${lead.mktoeligiblebold})
#if (($eligibleBold.equals("1")) && ($takenBold.equals("")))
#set ($showBold = 25000)
#else
#set ($showBold = 0)
#end
##******************Eligible or Taken Juno**********
#set ($takenJuno = ${lead.mktotakenJuno})
#set ($eligibleJuno = ${lead.mktoeligiblejuno})
#if (($eligibleJuno.equals("1")) && ($takenJuno.equals("")))
#set ($showJuno = 2500)
#else
#set ($showJuno = 0)
#end
##******************Eligible or Taken Niche**********
#set ($takenNiche = ${lead.mktotakenNiche})
#set ($eligibleNiche = ${lead.mktoeligibleniche})
#if (($scpMember.equals("Coreg Not a Member")) && ($coReg.equals("niche")))
#set ($showNiche = 0)
#elseif (($eligibleNiche.equals("")) && ($coReg.equals("campusreel")) && ($takenNiche.equals("")))
#set ($showNiche = 2000)
#elseif (($eligibleNiche.equals("1")) && ($takenNiche.equals("")))
#set ($showNiche = 2000)
#else
#set ($showNiche = 0)
#end
##******************Eligible or Taken Christian Connector**********
#set ($takenCC = ${lead.mktotakenChristianConnector})
#set ($eligibleCC = ${lead.mktoeligiblechristianc})
#if (($eligibleCC.equals("1")) && ($takenCC.equals("")))
#set ($showCC = 2500)
#else
#set ($showCC = 0)
#end
##******************Eligible or Taken Nitro**********
#set ($takenNitro = ${lead.mktotakenNitro})
#set ($eligibleNitro = ${lead.mktoeligiblenitro})
#if (($eligibleNitro.equals("1")) && ($takenNitro.equals("")))
#set ($showNitro = 2000)
#else
#set ($showNitro = 0)
#end
##Adding up the dollars available
#set ($subtotal = $math.add($showNiche, $showBold, $showNitro, $showCC, $showJuno, 13000))
#set ($formattedTotal = $number.format("number", $subtotal))
=?UTF-8?Q?${esc.d}?=${formattedTotal}
SanfordWhiteman
Level 10 - Community Moderator

Re: Using an email script token in the subject line

Well, it makes sense that the Q-encoding shows up, since that’s the literal output and it has no special meaning in the body, only in the Subject. But you probably can take out the Q-encoding as it wasn’t the cause/solution — the cause is all the literal whitespace.

 

 

 

 

Michael_McGowa1
Level 3

Re: Using an email script token in the subject line

Got it. Thanks Sanford.