Re: Decode URI component using velocity script

Anonymous
Not applicable

Decode URI component using velocity script

Hi, is there a way do decode a URI component using Velocity Script from within the Marketo environment?

5 REPLIES 5
SanfordWhiteman
Level 10 - Community Moderator

Re: Decode URI component using velocity script

Sure, easy peasy.

#set( $decodedField = $link.decode($lead.encodedField) )

Anonymous
Not applicable

Re: Decode URI component using velocity script

Sadly, when I make a token with just the script:

#set( $decodedField = $link.decode('Daves%20Super%20Fun%20Test%20Fundraiser') )

This is the decoded field: $decodedField

Then try and send an email with it, I get the error:

An error occurred when procesing the email Rendered_Email_Velocity_Error_Area_?!

near

?
SanfordWhiteman
Level 10 - Community Moderator

Re: Decode URI component using velocity script

Works for me.

Did you send a real email (always use a real email to test Velocity, not a sample).

Anonymous
Not applicable

Re: Decode URI component using velocity script

If by "a real email", you mean "an email triggered in a smart campaign", yes, I tried it by doing that.  No email was sent.  (I had originally been sending a sample.)

Is there something else I have to do to get this hooked up properly?  (I'm currently working in sandbox.)

SanfordWhiteman
Level 10 - Community Moderator

Re: Decode URI component using velocity script

I think you have a broken LinkTool (and testing tells me you're not alone).

DM me and I'll send you the fix (it's undocumented so I'm not going to pub it here as yet).