WrapLongURL()

Returns a shortened URL when provided with a URL that contains over 975 characters. Use this function to mitigate a known limitation with long URLs in Microsoft Outlook 2007–2013.

URLs that you shorten using this function are incompatible with Always On Clicks. If your Member DB is unavailable, the function returns an error.

Availability 

Marketing Cloud Engagement ✅ Yes
Marketing Cloud Next ❌ No

Syntax 

1WrapLongURL(urlToShorten)

The WrapLongURL() function has one parameter:

  • urlToShorten (string): Required. The URL to shorten.

Usage 

To use the function, pass it a URL to shorten. This example uses the resulting shortened URL in an HTML <img> tag.

1<!-- URL shortened for the purposes of illustration -->
2<img
3  src='%%=WrapLongURL("http://example.com/cb7de81e0b2845bd461c4543...8eef4715bbbe52c33831a02f/image.jpg")=%%'
4/>

If the URL contains more than 975 characters, the function returns a shortened link that redirects through the Marketing Cloud Engagement servers. If the URL contains fewer than 975 characters, the function returns the URL unchanged.