Encoded URLs for E-mail 2.0 Modules? | Community
Skip to main content
December 8, 2016
Solved

Encoded URLs for E-mail 2.0 Modules?

  • December 8, 2016
  • 1 reply
  • 2862 views

Hey, folks!

I'm currently working on developing modules for a new e-mail 2.0 template. I'd like to URL encode content (titles, URLs, descriptions, et cetera) that our marketing team will add to fields on 2.0 modules so that we can include links for Facebook sharer, Tweets, LinkedIn Share Articles, and so on, right in our e-mail templates.

Is there a clever way to URL encode content added to string variable fields, so that we can use some bits of text like this:

To produce an encoded URL, like this:

I'd love to see this as option on the variables themselves when you insert them, so that you can use the same string in multiple places, encoded and unencoded, but I'd settle for redundant fields if I had to.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by SanfordWhiteman

For variables, no.

You can URL-encode Lead or Company fields (or actually any strings) in Velocity. But variables don't go through that same pipeline.

1 reply

SanfordWhiteman
SanfordWhitemanAccepted solution
New Participant
December 8, 2016

For variables, no.

You can URL-encode Lead or Company fields (or actually any strings) in Velocity. But variables don't go through that same pipeline.

December 8, 2016

Okay. Thanks, Sanford! I was afraid of that, but thanks for the quick response.

SanfordWhiteman
New Participant
December 8, 2016

Variables in emails can get sloppy for this reason.  In LPs, the template author can exert control over display (via JS) but in emails the least privileged author has too much control, if you ask me.

You can also bounce all the links off a redirector that does the rewrite. So instead of linking to twitter.com/intent you link to link.agf.com/twtter.  Then your page knows to URL-encode its whole query string and pass it to twitter.com.