SOLVED

Marketo Image URL Encoding

Go to solution

Marketo Image URL Encoding

Hi.

Using Movable Ink and am at a wall. I'll get right to it.

This works when pasted into an email template using the string output of the encoded date:

http://www.movable-ink-6816.com/p/rp/0f114b2c0c7ed0b1.png?mi_u=12345&mi_date=May+8%2C+2018+9%3A48+AM

This does not work, with token included that calculates the above string format, and actually breaks the template table layout (attached example of 600px table structure during render preview):

http://www.movable-ink-6816.com/p/rp/0f114b2c0c7ed0b1.png?mi_u={{lead.Id}}&mi_date={{my.mi_dateTime}...

Everything seems to function outside of trying to implement it within Marketo. They index the image after tokens process and things go south. Physical inbox previews are the same broken-ness. The moment you add mi_dateTime the HTML syntax is messed up (no idea why?). Attached screen grab.

Does Marketo not support this use case? Or I don't understand part of the rendering stack.

This is the mi_dateTime velocity:

#set ( $a = $date.get('default','short' ) )

#set ( $a = $esc.url($a) )

$a##

-sb

1 ACCEPTED SOLUTION

Accepted Solutions

Re: Marketo Image URL Encoding

Lel. Nvm.

It was ## in the velocity code.

To this day don't understand why sometimes strings require that to not add whitespace characters and sometimes it breaks templates such as in this case.

View solution in original post

5 REPLIES 5
Level 10 - Champion Alumni

Re: Marketo Image URL Encoding

Can you post all of the code?

Did you ask Moveable Ink?

How are your tokens formatted? Screenshot?

Re: Marketo Image URL Encoding

Lel. Nvm.

It was ## in the velocity code.

To this day don't understand why sometimes strings require that to not add whitespace characters and sometimes it breaks templates such as in this case.

View solution in original post

Level 10 - Community Moderator

Re: Marketo Image URL Encoding

To this day don't understand why sometimes strings require that to not add whitespace characters and sometimes it breaks templates such as in this case.

Well, in this case if you didn't have a line break at the end of the token code, you didn't have anything in the token to escape. If you just end a token without hitting Enter, there's no trailing whitespace.

Re: Marketo Image URL Encoding

Makes sense.

I believe it's only if you add a break followed by velocity stuffs, so you're removing the newline character? I know I've had issues with it in the past with added spaces. Maybe I had a newline for some reason.

Is it expected that adding a comment in this fashion should mess with the HTML? It seems to comment out whatever gets attached.

I imagine something like this happens during the render: #your velocity doings stuff () () ##<html stuff is now commented out on this line>So it's no longer there</html stuff>

Level 10 - Community Moderator

Re: Marketo Image URL Encoding

I imagine something like this happens during the render: #your velocity doings stuff () () ##<html stuff is now commented out on this line>So it's no longer there</html stuff>

Exactly.

Velocity (or rather Marketo's use of Velocity) is remarkably unencapsulated/greedy. If you don't have something to comment out within the token it will find something.