1

I'm testing consumer-facing HTML email for a client. In several areas, business names are dynamically added to the text. Sometimes the business name could be, for instance, "Staples.com". Mac Mail is automatically linking this.

In our case it's a problem, because we need to tightly control the exit points for the user. In some cases, we need to track and report exits, but the autolink over-writes our tracking link. Additionally, the auto-link comes with its own light blue color and formatting, so that on our medium-blue background, it is difficult to read.

How can I construct the a tag around the text to prevent Mac Mail from adding ANY link or formatting? I need Mail to leave it alone!

Kara
  • 6,115
  • 16
  • 50
  • 57
Deborah
  • 4,316
  • 8
  • 31
  • 45
  • possible duplicate, without answer unfortunately. http://stackoverflow.com/questions/7625880/prevent-urls-from-appearing-as-links-in-mail-clients – Rob Sep 13 '13 at 17:26
  • thank you for the link. It didn't have a suggestion that solves my problem. The best suggestion was to trick it with spans (Staples.com), but since the field will be dynamically populated with the text string, I won't be able to get spans in there. – Deborah Sep 13 '13 at 17:29
  • Substring? and replace functions? – Rob Sep 13 '13 at 17:32
  • This might be possible, but it's the last-hope since it involves our overtaxed engineering team. I'm hoping for another way that doesn't involve this. – Deborah Sep 13 '13 at 18:18
  • Found a workaround, posted below. Thank you everybody. – Deborah Sep 13 '13 at 19:01

1 Answers1

0

I kind of feel like I cheated when I answer my own question, but maybe this will help someone else. This was just tested and worked. The key appears to be to add a valid website in the href of the a tag. That's what I did, and then forced in a bunch of formatting to ensure it did not look anything like a link, even though it is one.

<a style="color:#ffffff; text-decoration:none; cursor: text;" href="http://www.my-tracking-link.com" class="welcomelink">Staples.com</a>

.welcomelink repeats the inline styles and also manages the hover and visited states.

Deborah
  • 4,316
  • 8
  • 31
  • 45
  • From memory (correct me if I'm wrong), the address doesn't need to be a valid website, it would be better to keep it as `href=""` or `href="#"` to avoid redirecting the user elsewhere. – John Sep 13 '13 at 19:24
  • When I tested it, both of those options were still overwritten by MacMail and Yahoo Mail's inserted link. Since I couldn't prevent the link insertion this way, meaning it was either their URL or my URL, I caused a trackable dynamic URL to be inserted instead. – Deborah Oct 16 '13 at 06:50