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):
- In Google Calendar, register your mobile phone to enable SMS notifications.
- In Gmail, create a new label named 'Send text'.
- 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.
- Send an email to yourself to try this filter.
- In Google Docs, open a new spreadsheet.
- Choose the menu Tools > Script Editor.
- 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); }
- Save the script.
- Click the Run icon. A pop-up opens asking you for your authorization to access the Gmail and Google Calendar services.
- Click the Authorize button.
- Click the Run icon again.
- 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.
23 comments:
Give me a video of this tutorial please
Brilliant!
...Alas, not very practical (as the link implies).
Nice. But Not Work Me. Please Screen Shot Add. It s Very Impotent Article .Thank
Nice. But Not Work Me. Please Screen Shot Add. It s Very Impotent Article .Thank
@Ashwani Chohan: All of my friends and colleagues are using sms feature of google, using this procedure.
I think adding screen-shots would unnecessary.
With Regards
Ashik
Thanks !I Am Waiting Sir , and robot Code Very difficult. I Try 5 Time . Make Post.Thanks !!
thanks bro its working fine, you are greate...
Great tip.. I was searching for this from long time and got the solution here..
The best way to get gmail alerts on mobile via sms is to use 3rd party service called weekwill.com. I have been using it since long time now and its just works perfect for me. Whenever I get email in my gmail inbox, I get sms instantly. Its great. It doesn't require internet connection in your phone or any 3G. Try it.
Hi
This is great!
But do you have to keep pressing run from excel for the notifications to go?
Hi Girish,
You have to run the code one time and save it. That's it...Nothing more.
Regards
Ashik
Getting error as :
Illegal character. (line 2)
It's only sending the subject of the mail. Is it possible to send whole mail?
Thanks, works great. However I seem to get between 2-4 sms notification for each email. Is there a way to specify for just 1 sms per email?
Many thanks.
@Anonymous:
I think it's possible to get the whole message.
Try changing the script by replacing "getFirstMessageSubject()" with "getMessages()".
REF: https://developers.google.com/apps-script/service_gmail
You are missing the most important thing to make it work.. ( from your ref link )
Using a time-driven trigger
A time-driven trigger is useful to check the label ‘Send text’ periodically and send you a text each time a new email is found with this label. The function sendText can be automatically triggered every day, hour or even minute.
To install a trigger:
In the script editor, open the Resources menu and click Current script's triggers... The Current script's triggers dialog opens.
Click on the link that says No triggers set up. Click here to add one now. A dialog opens, asking you to set up triggers.
Ensure that the function sendText and the event 'Time-driven' are selected.
Select the appropriate time depending on your needs. The script can be automatically triggered every minute, hour, day, etc.
Click the Save button.
nyc one..works good...but we get 2-4 msgs for an email..any way to get only 1?
So I'm not the only one what receives 2 or 3 notifications. First I thought it was because I modified the script so it creates the events in a secondary calendar, because I didn't want to overcrowd my calendar with these notifications (I use multiple calendars and sync them with my e-mail client). My script looks like this:
function sendText() {
var label = GmailApp.getUserLabelByName('SMS');
var threads = label.getThreads();
var now = new Date().getTime();
var cal = CalendarApp.getOwnedCalendarById('id@group.calendar.google.com');
for(i in threads){
cal.createEvent('Email- '+threads[0].getFirstMessageSubject(),
new Date(now+60000),
new Date(now+60000)).addSmsReminder(0);
}
label.removeFromThreads(threads);
}
You must change the calendar ID with your own ID.
Hi,
thanks for this article.
Regards,
Rafal
http://alert-please.com
Google Script will send you an email notification alert if you have not received an expected email message in xx number of days.
http://baumbach.com/google-script/
Video Tutorial
www.youtube.com/watch?v=jES0lh5VJMA
Very interesting solution. Personally I use alert-please.com. It is not for free but it works quite good.
Post a Comment