Re: Using tokens for downloading .pdfs or .jpgs is not working.

David_Beasley
Level 2

Hi Everyone,

I have an email where i want the user to click to download a personalized .pdf or jpg. The specific file they download depends on their email address.

So I use a token for the download link called {{my.CMOcert}}

The velocity script assigns the value of the image url (except for the http:// part of course) to the token CMOcert based on email address.

So then in my HTML, I say "Get your personalized certificate <a href="http://{{my.CMOcert}}">here</a>

So when I set up the email in a campaign and run it using my own email address, I clicked the link and nothing happens. What am I doing wrong, or perhaps tokens do not work with URLs?

This should work right? If someone can help, please do!

Big Dave

16 REPLIES 16
Mark_Price
Level 7

Do you have it setup like this?

<a href="http://{{my.velocityToken}}">this is not good</a>

If so, then that is probably the issue. You should output the entire link / url within Velocity including <a href=""></a> tags opposed to using the email script's output within a link. This will break when link tracking is applied.

Here's a resource I use quite a bit for obscure email scripting info (written by Sanford from this community)

https://blog.teknkl.com/tag/velocity/

David_Beasley
Level 2

Thank you Mark for your replay.

Unfortunately, when I use the entire url as my token ie

SanfordWhiteman
Level 10 - Community Moderator

Output the entire <a> tag from Velocity.

David_Beasley
Level 2

Hi Stephen. It doesn't work. In fact, making the token the entire url

results in a blank space. Dang I am really stuck.

On Mon, Apr 15, 2019 at 4:10 PM Sanford Whiteman <

SanfordWhiteman
Level 10 - Community Moderator

Sanford. Or Sandy.

Please show us the exact code of your Velocity token (highlighted as Java, the closest language match).

David_Beasley
Level 2

#if( $lead.Email == "myemail@mydomain.com" )<a href=" http://na-ab22.marketo.com/rs/343-QLB-570/images/fistandlastname.jpg">here</a>

#end

I had to sanitize the email and url a bit, but you get the picture.

So the call-to-action in the html email says "you may download your

certificate {{my.CMOcert}}." and of course the token "should" then display

as the word "here" linked to the image to be downloaded.

I am seriously stuck. When I test the email (not via send sample but as an

actual smart campaign which send s the email to me), the link is

missing...just a blank space.

Dave B.

On Mon, Apr 15, 2019 at 5:06 PM Sanford Whiteman <

SanfordWhiteman
Level 10 - Community Moderator

Please highlight the code as Java to maintain readability. (Otherwise the Jive editor changes the content, not to mention the variable-width font is not accessible.)

There's no <a> tag at all in your code as currently shown.

David_Beasley
Level 2

Highlight the code as java?

On Mon, Apr 15, 2019 at 5:36 PM Sanford Whiteman <

SanfordWhiteman
Level 10 - Community Moderator

https://s3.amazonaws.com/blog-images-teknkl-com/syntax_highlighter_v3.gif

David_Beasley
Level 2

#if( $lead.Email == "myemail@mydomain.com" )<a href=" http://na-ab22.marketo.com/rs/343-QLB-570/images/fistandlastname.jpg">here</a>

#end

Sorry I cannot see where I can access the "highlighting" option.

On Mon, Apr 15, 2019 at 5:55 PM Sanford Whiteman <

SanfordWhiteman
Level 10 - Community Moderator

Click "Advanced Editor."

David_Beasley
Level 2

Where?????????????????????????? Where is "advanced

editor"????????????????????????????????????????? Can you send me a screen

shot please?????

On Mon, Apr 15, 2019 at 9:58 PM Sanford Whiteman <

SanfordWhiteman
Level 10 - Community Moderator

pastedImage_0.png

David_Beasley
Level 2

Thanks for your help. That advanced editor feature is not appearing on my

screen. I must have a different setup than you.

On Mon, Apr 15, 2019 at 10:04 PM Sanford Whiteman <

SanfordWhiteman
Level 10 - Community Moderator

Make sure you click the title of the thread to go into single-thread view.

And that you're not on mobile.

Mark_Price
Level 7

woopsy, had the reply window open too long, shoulda known you would be on it