Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Prevent Gmail adding links to Addresses?

I have created a HTML email that contains some address information, in my testing I have noticed in Gmail.com the email automatically creates a link to the address leading to Google Maps.

Is there a way I can prevent this using mark up somehow?

like image 296
InvalidSyntax Avatar asked Sep 21 '17 10:09

InvalidSyntax


People also ask

How to add email addresses to contacts in Gmail?

Click the “See All Settings” button. Under the “General” tab, scroll down to the “Create Contacts for Auto-Complete” section. As we mentioned above, Gmail enables the option to add the email address to your contacts automatically. Select the “I’ll add contacts myself” option. Click the “Save Changes” button at the bottom.

How to prevent Gmail from being displayed as a link?

Suppose your display url is "abcdUrl.com" To prevent gmail from showing as a link, wrap it in an anchor tag This works well in gmail. Thanks for contributing an answer to Stack Overflow!

How to remove email addresses from Google Contacts?

Here’s how you can remove those email addresses from Google Contacts. Head to the Google Contacts page and sign in to the account with unwanted emails in contacts. Next, select “Other Contacts” on the left column. All the email addresses Gmail added over the years will appear there. Click one of the contact icons to select it.

How to stop Gmail from crowding up my contacts?

However, you can disable Google’s behavior altogether and prevent unwanted emails from crowding your Google Contacts. First, open the Gmail website, login into your Gmail account, and click on the gear icon in the top-right corner. Click the “See All Settings” button.


2 Answers

The solution is to beat Gmail to it and wrap the address in your own <a> tags and change the styling to match normal text.

e.g. 123 Fake Street, London should be
<a href="" style="text-decoration:none !important">123 Fake Street</a>

like image 92
InvalidSyntax Avatar answered Sep 18 '22 04:09

InvalidSyntax


I have an issue where gmail and other browsers like IOS want to take an email address, street address or telephone number and underline it in blue, which does not meet my brand guidelines or work with the overall design of the email. I understand your specifically asking about addresses, I think this might help with similar problems as well.

I take several steps to stop data detectors from improving my email.

In the header, I add this:

<meta name="format-detection" content="email=no" />
<meta name="format-detection" content="telephone=no" />

In the style sheet I add some specific code directed at data detectors:

*[x-apple-data-detectors], .x-gmail-data-detectors, .x-gmail-data-detectors *, .aBn {
    border-bottom: 0 !important;
    cursor: default !important;
    color: inherit !important;
    text-decoration: none !important;
    font-size: inherit !important;
    font-family: inherit !important;
    font-weight: inherit !important;
    line-height: inherit !important;
}

Finally, In the address itself, I add non-printing characters like &zwnj;. The characters don't show up in the final product, but they help dissuade Outlook or Gmail or IOS from thinking it's content it needs to underline. Something like this:

1313&zwnj; Mockingbird Lane
Mockingbird Heights, CA &zwnj;91608

Then again, working with each data detector and styling their output to match the email isn't a bad thing either. It might take longer, but then any dates you mention will link to a calendar, phone numbers would work, addresses would show on maps.

Good luck.

like image 38
gwally Avatar answered Sep 18 '22 04:09

gwally