Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

Changing to token to camelcase

Avatar

Avatar
Give Back
Level 1
daver37819942
Level 1

Like

1 like

Total Posts

34 posts

Correct Reply

0 solutions
Top badges earned
Give Back
Ignite 1
Validate 1
Boost 1
View profile

Avatar
Give Back
Level 1
daver37819942
Level 1

Like

1 like

Total Posts

34 posts

Correct Reply

0 solutions
Top badges earned
Give Back
Ignite 1
Validate 1
Boost 1
View profile
daver37819942
Level 1

17-05-2021

How does one update to use camelcase in standard using out of box updating html?

<td style="padding-top:10px;padding-bottom:20px;padding-left:10px;font-size:18px;color:#394f67;vertical-align:top;line-height:24px;"><span style="padding-top:10px;padding-bottom:10px;padding-left:10px;font-size:18px;color:#394f67;vertical-align:top;line-height:24px;">Hello, <span class="acr-field nl-dce-field" data-nl-expr="/context/rtEvent/ctx/recipientFirstName" data-nl-type="string" contenteditable="false">Guest First Name (recipientFirstName)</span>!<br>
<br>
Welcome! xxxx xxxxx xxxx xxxx!</span></td>

 

If recipientFirstName comes in all caps or lowers, can this be adjust to camelcase inside html?

 

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Boost 250
MVP
DavidKangni
MVP

Likes

256 likes

Total Posts

372 posts

Correct Reply

151 solutions
Top badges earned
Boost 250
Validate 1
Give Back 5
Give Back 3
Give Back 25
View profile

Avatar
Boost 250
MVP
DavidKangni
MVP

Likes

256 likes

Total Posts

372 posts

Correct Reply

151 solutions
Top badges earned
Boost 250
Validate 1
Give Back 5
Give Back 3
Give Back 25
View profile
DavidKangni
MVP

18-05-2021

Create a perso block like below and call it in your email

function toSmartCase(context.profile.firstName)
{
  var strLower = str.toLowerCase(context.profile.firstName);
  var nChar    = strLower.length;
  for (var i=0; i < nChar; i++)
    if ( i == 0 || strLower.charAt(i-1) == ' ' || strLower.charAt(i-1) == '-' )
      strLower = strLower.substring(0, i) + strLower.charAt(i).toUpperCase() + strLower.substring(i+1);

  return strLower;
}

Thanks,

David

Answers (0)