5

I am looking for any way to make the entire screen blink red, or whatever color, when there is an unread email. It could be for any email client. I have done a lot of googling and can't find anything. There is an add-on to thunderbird that creates a little blinking notification, but it only appears very small in the lower right hand corner of the screen.

I was thinking of maybe some add-on to Firefox or Chrome that would allow me to write custom css and javascript that would run on Gmail and make the blinking happen. Any ideas are greatly appreciated.

I know this is not you regular SO question, but y'all are great and I don't know where else to turn. If there is a better forum out there for this type of question, you could also inform me of it.

Thanks!

dezman
  • 18,087
  • 10
  • 53
  • 91
  • All client... you mean all servers ? GMail, Hotmail, Yahoo, and other web based email services, And Pop/Imap servers also ? – ixe013 Mar 18 '13 at 19:11
  • @ixe013 I mean any client, I don't care which one I use. The answer could be some specific add-on for thunderbird. It doesn't need to be for all email services. But it does need to work with Windows and Pop/Imap. – dezman Mar 18 '13 at 19:32
  • 1
    Why would anyone want to even think about doing this? If you really manage to get this done, prepare yourself to getting myriads of hate mail from enerved users. – yunzen Mar 21 '13 at 15:10
  • 1
    @ixe013 He wrote 'any' not 'every' or 'all'. – yunzen Mar 21 '13 at 15:11
  • 3
    @HerrSerker there are no 'users' involved, its just my dad getting orders at his cafe and wanting a visible signal that he got an email order. – dezman Mar 21 '13 at 16:40
  • I think you should use ThunderBird from here http://www.mozilla.org/en-US/thunderbird/download – Jitesh Mar 22 '13 at 17:42
  • @Jitesh I am already aware of the existence of Thunderbird; it does not do what I am trying to accomplish by itself. – dezman Mar 22 '13 at 19:25

4 Answers4

2

I have found this program while searching, haven't tried it. But it says it can execute an external program when email arrives. So seems like you can write a little C# application that can perform the task you want and execute when new email arrives.

http://www.jsonline.nl/Content/Poppy/Poppy.htm

btevfik
  • 3,391
  • 3
  • 27
  • 39
1

Grab the current google mail checker extension sample (https://developer.chrome.com/extensions/samples.html). Convert it to a packaged app (grab the pieces you want), open a very large window and close it quickly. That should do the trick. Sadly Fullscreen doesnt seem to be possible. But i dont know if thats a problem.

Wouter Schut
  • 907
  • 2
  • 10
  • 22
  • Note https://chromiumcodereview.appspot.com/12205002 re fullscreen support in packaged apps. This should be in M26 dev, maybe beta channel by now. – sowbug Mar 17 '13 at 03:39
1

Instead of making a Chrome plugin, I would either make the window title blink or use HTML5 Notifications. Create a simple page which polls your IMAP Gmail for new messages, and include gmail in a large iFrame. If a new message is found, your outer window can issue the notification.

HTML5 Notifications: http://www.html5rocks.com/en/tutorials/notifications/quick/

Blinking Title (adopted from this):

var newMailBlinker = (function () {
    var oldTitle = document.title,
        msg = 'New Mail!',
        timeoutId,
        blink = function() { 
            document.title = document.title == msg ? ' ' : msg; 
        },
        clear = function() {
            clearInterval(timeoutId);
            document.title = oldTitle;
            window.onmousemove = null;
            timeoutId = null;
        };

    return function () {
        if (!timeoutId) {
            timeoutId = setInterval(blink, 1000);
            window.onmousemove = clear;
        }
    };
}());

PHP Poll Gmail IMAP (adopted from this):

$t1=time();//mark time in
$tt=$t1+(60*1);//total time = t1 + n seconds

do{
    if(isset($t2)) unset($t2);//clean it at every loop cicle
    $t2=time();//mark time
    if(imap_num_msg($imap)!=0){//if there is any message (in the inbox)

        $mc=imap_check($imap);//messages check
        //var_dump($mc); die;//vardump it to see all the data it is possible to get with imap_check() and them customize it for yourself
        echo 'New messages available';

    }else echo 'No new messagens';

    sleep(rand(7,13));//Give Google server a breack
    if(!@imap_ping($imap)){//if the connection is not up
        //start the imap connection the normal way like you did at first
    }

}while($tt>$t2);//if the total time was not achivied yet, get back to the beginning of the loop

jQuery AJAX Polling to your IMAP script (adopted from this):

// make the AJAX request
function ajax_request() {
  $.ajax({
    url: '/path/to/gmail/imap/checkMessages.php',
    dataType: 'json',
    error: function(xhr_data) {
      // terminate the script
    },
    success: function(xhr_data) {
        console.log(xhr_data);
        if (xhr_data.status == 'No new messages') {
            setTimeout(function() { ajax_request(); }, 15000); // wait 15 seconds than call ajax request again
        } else {
            newMailBlinker(); // blink the title here for new messages
        }
    }
    contentType: 'application/json'
  });
}

Obviously you wouldn't use jQuery AND PHP to poll. Pick one to do the polling. I'd recommend have the client do the polling and have PHP check IMAP once per connection. That being said, these snippets should get you started :)

Community
  • 1
  • 1
AlienWebguy
  • 76,997
  • 17
  • 122
  • 145
0

Assuming your dad has the client page always opened, you could just write an extension and manipulate the screen with JS.

You could for example:

  1. Use the gmail client in chrome
  2. Write a chrome extension that checks for new e-mails that come in. You could achieve this by identifying new e-mails. I believe gmail uses a specific css class for new e-mails. So your JS just needs to check for that class.

  3. Have the extension change the page from white to red and back to white a few times (or till the e-mail is read).

You could also possibly have the chrome extension play a sound when a new email arrives?

I found chrome extensions a lot easier to use than FF, especially if you're just going to use JS.