SMS alerts for important emails in Gmail

What I would like to do is to receive SMS notifications on my phone when I receive important emails in Gmail ( important as filtered by the Inbox function in the Basic Rights section. - Search: “is important” in Gmail) . I found this neat little instruction (which works, except for the extra features that I would like to implement) techawakening.org (http://techawakening.org/free-sms-alerts-new-email-on-gmail-with -google -docs / 1130 /) and tried to do this, but due to the lack of technical background, I have not succeeded so far. Another thing that I tried to embed in the script is the ability to specify a specific calendar (the script uses the Google calendar for sms notifications), reminder events should be saved (I prefer that they do not clutter up my main calendar by default).

Here is what I came up with:

function sendsms() { var label = GmailApp.getUserLabelByName("sendsms"); var firstThread = GmailApp.getInboxThreads(0,1)[0]; var firstThread = firstThread.isImportant(); var firstThread = firstThread.addLabel(label); var threads = label.getThreads(); var now = new Date().getTime(); for(i in threads){ var message = threads[0].getMessages()[0]; var sender= message.getFrom(); CalendarApp.getCalendarsByName('Invisible').createEvent(threads[0].getFirstMessageSubject() + " By: "+sender,new Date(now+60000),new Date(now+60000)).addSmsReminder(0); } label.removeFromThreads(threads); } 

Can anyone help me out?

Thank you very much in advance.

Phil

0
source share

All Articles