2

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> 
4
  • 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... Commented Feb 7, 2019 at 15:53
  • 1
    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 Commented Feb 7, 2019 at 15:58
  • 2
    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/…) Commented Feb 7, 2019 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. Commented Feb 7, 2019 at 16:32

1 Answer 1

4

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">

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .