Greasemonkey Script to Prevent Smartsheet Emails From Scrolling Off the Screen

On March 23, 2017, Smartsheet deployed a software update that made its alert emails very difficult to use in Gmail. They added blank space to the updated table rows that pushes content far off the right side of the screen. The image below shows the difference. The email on top is what alert emails previously looked like in Gmail; the email on the bottom is how they appear now.

I asked Smartsheet to fix this problem on April 11th. They assure me that the development team knows about the problem but they can’t provide a timeline of when it will be fixed.

Until then, I’ve created a Greasemonkey script that makes the alert emails usable again. Greasemonkey is a browser add-on that lets you run scripts to modify a web page once it is downloaded to your browser. Install Greasemonkey for Firefox here or Tampermonkey for Chrome here. Then click the following link:

Install Userscript to Resize Smartsheet in Gmail

Reload your Gmail tab and the script should be active. This script works by checking that the text “support@smartsheet.com” appears on the page and then removes the width attribute from all “td” elements (table cells) and changes the min-width property to zero.

If you have an improvement to the script, please let me know. If the link above doesn’t work, here is the full script:

// ==UserScript==
// @name        Resize Smartsheet in Gmail
// @author      John Steele, Auxiliary Teams Inc.
// @namespace   https://www.auxteams.com/
// @description Resizes Smartsheet email content to fit inside Gmail.
// @version     2017-07-02
// @include     /^https?://mail\.google\.com//
// @match       https://mail.google.com/*
// @match       http://mail.google.com/*
// @grant       none
// @require     http://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js
// ==/UserScript==

/* 

    LICENSE
    
    Copyright (C) 2017 John Steele and Auxiliary Teams Inc. All Rights Reserved. 
    This work is distributed under the W3C(R) Software License [1] in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    [1] http://www.w3.org/Consortium/Legal/copyright-software
    
*/

$(document).ready(function(){
  $(document).shrinksmartsheetgmail();
});

$(document).click(function(){
  $(document).shrinksmartsheetgmail();
});

$.fn.shrinksmartsheetgmail = function(){
  $(document).ready(function(){
    if ($('div:contains("support@smartsheet.com")').length > 0) {
      $("td").each(function(){
        $(this).siblings().css("min-width","0px")
        $(this).siblings().removeAttr("width")
      });
    }
  });  
};