LinkedInTwitterFacebook

Google Apps Script – trigger and gmail – part 002.

What is a trigger ? The google told us:

A trigger is a type of script resource that listens for a particular event and executes a function when that event fires.

Let’s make a simple example using triggers.

I will make a script to sent a simple mail every 1 minute.

First will need to see my first tutorial.

Follow the steps to create a new google spreadshet and open a new script.

After that add this source code to your script and change your_mail with your real gmail account:

Go to Resources -> All your triggers …

google apps script trigger

You will see something like this. Set your trigger like in the next image.

google apps script trigger

Save your script and run it. Go to gmail account will see one mail each minute.

You can use the blue notification link is used to send email notification…you can use that.

All emails I got from this script.

google apps script trigger

To stop this trigger just go to Resources -> All your triggers delete the trigger and save your script.

NOTE: Check if you stop the script! Also your email will be full with emails from this script.

Share