Wednesday, April 25, 2012

Get SMS notification for emails at GMail


Romain Vialard is a Google Apps Script Top Contributor. He has contributed interesting articles and blog posts about Apps Script. - Jan Kleinert
I just had to share this finding with all of you. Now you can get SMS alert or notifications for important emails at GMail.


Just follow the steps described at the below link:
https://developers.google.com/apps-script/articles/gmail_filter_sms#section1
or,
Just follow the steps below(copied from above link):


  1. In Google Calendar, register your mobile phone to enable SMS notifications.
  2. In Gmail, create a new label named 'Send text'.
  3. In Gmail, create a filter to apply the label 'Send text' to important emails. For example, you may want consider emails from your boss containing the word 'urgent' as important.
  4. Send an email to yourself to try this filter.
  5. In Google Docs, open a new spreadsheet.
  6. Choose the menu Tools > Script Editor.
  7. Copy and paste the following script:
    function sendText() {
      var label = GmailApp.getUserLabelByName('Send text');
      var threads = label.getThreads();
      var now = new Date().getTime();
      for(i in threads){
        CalendarApp.createEvent('IMP- '+threads[0].getFirstMessageSubject(),
                                new Date(now+60000),
                                new Date(now+60000)).addSmsReminder(0);
      }
      label.removeFromThreads(threads);
    }
  8. Save the script.
  9. Click the Run icon. A pop-up opens asking you for your authorization to access the Gmail and Google Calendar services.
  10. Click the Authorize button.
  11. Click the Run icon again.
  12. After one minute, you should receive a text on your mobile device, containing the subject of the email you wrote and sent in Step 4.

Wednesday, April 18, 2012

Ruby gem 'churn' dependency conflict solution

The main reason of writing this solution is that I haven't found any solution regarding this problem by searching till date.

Scenario: 
Just wanted to run some sample test scripts to explore ruby gem "churn".

Problem:
Installed 'churn-0.0.15', latest map gem 'map-5.1.0' and as churn required gem main so installed latest 'main.5.0.'. But gem 'main' required 'map' version '4.3.0', so I had installed that too.
Finally when I tried to run sample script, it gave me the following error
"Unable to activate churn-0.0.15, because map-5.1.0 conflicts with map (= 4.3.0) (Gem::LoadError)"
So, map 4.3.0 was conflicting with map 5.1.0, though in order to install 'churn' I had to install both of them.

Probable Solution:
I need to install only one 'map' gem which will satisfy both churn and  main.

Solution:
I uninstalled churn, map and main, all versions.

Then I installed 'map-4.3.0' then 'main-4.6.0' and finally "churn-0.0.15'.

It solved the conflict that I was having.

Similar Issues:
https://github.com/danmayer/churn/issues/10
https://github.com/jscruggs/metric_fu/issues/73