Tokenized URL with default text | Adobe Experience League Community
Skip to main content
Kanako_Tone2
Level 2
November 28, 2018
Question

Tokenized URL with default text

  • November 28, 2018
  • 1 reply
  • 1851 views

We have a custom URL field and when an email has a copy with this URL token, I'd like to show

- the URL as hyper link if the field has a value

- some text without hyperlink if the field does not have a value

Here, I created a test email below and sent a sample email to a lead whose URL field is blank.

And here's the sample email that came through. "Schedule a call" looks like a link, but it looks clickable. I'd actually like to have the text line "Let me know..." showing without the hyperlink feature. Is it ever possible?

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

1 reply

Grace_Brebner3
Level 10
November 28, 2018

Hey Kanako,

The logic you're trying to create is effectively:

  • If field is not empty, display: <a href="{{lead.your field here}}">text</a>
  • If field is empty, display: text

I.e., it's the removal of the <a> tag that you're trying to achieve, not the removal of the href value. Your current method isn't working because the logic is instead:

  • If field is not empty, display: <a href="{{lead.your field here}}">text</a>
  • If field is empty, display: <a href="">text</a>

What you want to use to achieve this is a velocity script token - there's lots of resources on community + the wider web that should help you with this.