1

I have a very complex link. It's a Google Calendar Link so it's very long and has all kinds of characters. (see image)

enter image description here

The link works fine when clicked directly and even works in the SFMC UI. It breaks once it gets to the email and the issue seems to be that RedirectTo is breaking it. It's replacing the ? with &. So I tried it without RedirectTo and the link doesn't work at all. Which is odd, because I've had times with not using RedirectTo works fine, and other times when it doesn't. And I've heawrd it's best practice to use it. I also know you can't track clicks without it, but we don't need to track clicks so that's not an issue. I just need to get this link to work. Anyone had a similar issue like this?

The really, really strange thing is that the MSO version of the link works

So the top one works, the bottom one doesn't:

<!--[if mso]>
<v:roundrect xmlns:v="urn:schemas-microsoft-com:vml" xmlns:w="urn:schemas-microsoft-com:office:word" href="%%=RedirectTo(@calendarInviteURL)=%%" style="height:40px;v-text-anchor:middle;width:180px;" arcsize="15%" stroke="f" fillcolor="#052E60">
<w:anchorlock/>
<center>
<![endif]--> 


<a href="%%=RedirectTo(@calendarInviteURL)=%%" style="background-color:#052E60;border-radius:5px;color:#ffffff;display:inline-block;font-family:arial,sans-serif;font-size:12px;font-weight:bold;line-height:40px;text-align:center;text-decoration:none;width:180px;-webkit-text-size-adjust:none;">ADD TO CALENDAR</a> 
  • Ok I found at least one issue and that is why the link wasn't working without RedirectTo. I was using preview and test and I need to uncheck track links, then the links work without RedirectTo, but still not sure why RedirectTo breaks it in the first place... – garek007 Feb 7 '19 at 15:53
  • And unfortunately I need to track other links in the email... We are using a triggered send, so I can turn this off in the triggered send, but none of the links will track then, and we can't have that. The issue seems to be when "Track Links" is turned on, then %%=v(@calendarInviteLink)=%% gets concatenated as click.mail.salesforce.com/%%=v(@calendarInviteURL)=%% and that's a bad link – garek007 Feb 7 '19 at 15:58
  • 1
    2 things to try: 1. Make sure to add an alias to the <a> tag - <a href="" alias="CalendarInvite">. 2. Try using the WrapLongURL() AMPscript function around it. RedirectTo(WrapLongURL(@calendareInviteURL)) (developer.salesforce.com/docs/…) – Gortonington Feb 7 '19 at 16:03
  • 2
    OMG WrapLongURL worked!!!! I read up on that and I didn't think it would work so I didn't try. I'm glad you suggested it! I tried URLEncode() and that didn't work either. This is great! Thank YOU! Post it if you want and I'll mark it. – garek007 Feb 7 '19 at 16:32
3

2 things to try:

  1. Make sure to add an alias to the tag - <a href="" alias="CalendarInvite">.
  2. Try using the WrapLongURL() AMPscript function around it.

<a href="%%=RedirectTo(WrapLongURL(@calendareInviteURL))=%%" alias="CalendarInvite">

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.