Token breaking when sending samples | Community
Skip to main content
New Participant
March 22, 2024
Solved

Token breaking when sending samples

  • March 22, 2024
  • 1 reply
  • 3989 views

Hello, I am using velocity script to set a link based on lead language, I have a series of 12 if/then statements.

 

The velocity script is working fine during previews in marketo, but when sending tests to my email, the link breaks. How should I format the output, so the link does does not break?

 

We have/want to use a tags on the email side instead of the velocity side for formatting' the reason is we use the token in multiple places in the email with different styling. What is the exact format I need to print my token via velocity script so the link does not break when sending emails?

 

Best answer by SanfordWhiteman

OK, that’s not a sample then. Terminology matters!

 

You need to output the whole link, e.g.:

## some Velocity ## some other Velocity <a href="https://${someVelocityVariable}">Visit</a>

1 reply

SanfordWhiteman
New Participant
March 22, 2024

As a rule, don’t use Send Sample to test Velocity tokens. Only use real emails.

 

As far as the links, as noted in lots of other places you need output the entire link, from opening <a> to closing </a>, from your Velocity code. Only outputting part of the link from Velocity isn’t supported.

megkartAuthor
New Participant
March 22, 2024

Thanks for the reply, yes testing with "real" emails as samples.

 

Would I be able to print https://$link via velocity script? 

Or how could I keep the a tags outside of velocity 

megkartAuthor
New Participant
March 22, 2024

Actually just tried that and the link breaks in the email (okay in the preview). 

 

I put $link as my output.