Tuesday, August 4, 2015

How Gmail Handles Preview Text

An email reply, dated April 22, 2015, from Brayden H., a technical specialist with Google Apps for Work.

I have spent some time this afternoon digging around in our code base and testing the behavior for myself in my test accounts.

What I have found is some variability in the number of characters that are selected to be in the snippet. Gmail is doing some amount of interpretation when deciding how much text to display. If there are additional spaces, or if a periods (.) are used you can get the snippet size to vary slightly, but within a narrow range.

Gmail takes the initial text of the body and uses it as the snippet shown in the thread list view. It will ignore spaces and line breaks and go straight to the actual text. If there is a line break it will convert it to a space in the snippet. I have gotten the front end to display different length snippets depending on the content, but they are consistently between 90 and 101 characters (based on testing done so far).

The simple answer is that you cannot prevent these from showing. Gmail will grab the first set of characters and display them if the recipient selected preference to show the snippets.