SOLVED

Re: Token breaking when sending samples

Go to solution
mkmarketo1
Level 2

Token breaking when sending samples

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?

 

ex3.jpgexample2.jpg

Tags (2)
1 ACCEPTED SOLUTION

Accepted Solutions
SanfordWhiteman
Level 10 - Community Moderator

Re: Token breaking when sending samples

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>

View solution in original post

8 REPLIES 8
SanfordWhiteman
Level 10 - Community Moderator

Re: Token breaking when sending samples

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.

mkmarketo1
Level 2

Re: Token breaking when sending samples

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 

mkmarketo1
Level 2

Re: Token breaking when sending samples

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

 

I put https://$link as my output. 

SanfordWhiteman
Level 10 - Community Moderator

Re: Token breaking when sending samples

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>
mkmarketo1
Level 2

Re: Token breaking when sending samples

Thanks so much! And does sending a tracking URL through velocity script break the tracking at all?

 

And is there a way to make the velocity script output as text instead of URL? When using a text token to put URL, I am not experiencing the same issue

Jo_Pitts1
Level 10 - Community Advisor

Re: Token breaking when sending samples

@mkmarketo1,

To get a little pedantic, you don't send a tracking link through Velocity.  You create a link in Velocity, and Marketo processes it after that into a tracked link. 

 

But if the question is 'are links created in Velocity tracked?' then the answer is yes, unless you specifically include the no tracking class.

 

Cheers

Jo

mkmarketo1
Level 2

Re: Token breaking when sending samples

For the way our tracking is setup, if the link is coming through velocity script, the link is not tracked. Is there anyway I can keep the https:// outside of the velocity script? Or print the script in text?

 

I know this works in text tokens 

Jo_Pitts1
Level 10 - Community Advisor

Re: Token breaking when sending samples

@mkmarketo1 can you clarify for me please.  Are you wanting a tracked link or not?

Cheers

Jo