Merely E-mail Your self From a Google Sheet

I needed to share with you one of many easiest apps scripts that has immense energy.
E-mail!
You may e mail others, however it’s also possible to e mail your self.
In any Google Sheet you may go to the menu: Extensions
Then click on on Apps Script
It’s going to open Apps Script in one other window.
If you have not ever written any scripts but it’l say this:
operate myFunction() {
}
We will change “myFunction” to say “emailMe”
after which let’s choose the A1 cell on tab Sheet1 to ship to our inbox day-after-day.
between the 2 curly brackets { }
write this:
MailApp.sendEmail(rec,sub,physique)
That is the easy script that emails a recipient (rec), an e mail with topic (sub) and a textual content physique (physique)
What we have to do now could be set these variables above it.
Now go to the entrance of MailApp and hit the enter button a pair occasions.
write var rec =
after which in quotes put your e mail handle.
like this
var rec = “andrew@BetterSheets.co”
and now that e mail that’s sending will ship to that e mail handle. that is additionally the place you may put another person’s e mail handle if you happen to’re sending them a every day report.
subsequent below that line add a return and let’s write var sub =
that is going to be our topic
I wrote
var sub = “Right now’s Report”
after which enter once more.
and let’s add the physique
var physique =
oh no. what will we do right here? it isn’t going to be simply textual content. It is going to be the cell within the sheet.
This is how we get that;
SpreadsheetApp.getActiveSpreadsheet().getSheetByName(“Sheet1”).getRange(“A1”).getValue()
So the entire line can be
var physique = SpreadsheetApp.getActiveSpreadsheet().getSheetByName(“Sheet1”).getRange(“A1”).getValue()
What that line means is that we’re deciding on the spreadsheet app, a inbuilt operate inside apps script, then we’re getting the lively spreadsheet file, your entire file, then we’re deciding on one sheet, “Sheet1” by identify, after which we’ll choose the vary. On this case “A1” so if you wish to change to a unique cell, change “A1” to the cell you need. after which we’re not deciding on the worth but till we add “getValue()”
and here is the loopy half, we’re just about carried out.
We’ve got to set a Set off to ship this e mail day-after-day. but when we needed to simply ship that e mail now we will hit “run”
however if you cannot. if it is grayed out. strive saving the script.
COMMAND + S, or hitting “save venture” which appears like a floppy disc icon within the Apps Script toolbar.
In the event you hit run from right here. which you would/ought to do to check it out, you then’ll must authorize the script. simply say sure and permit.
And verify your inbox, if you happen to modified the e-mail handle to your e mail. Or verify your despatched folder, if you happen to saved the rec variable to my e mail handle.
In the event you adopted alongside, and it did not work, or it did. let me know
If you wish to see the script your self copy this sheet: https://docs.google.com/spreadsheets/d/1-jPmuxECi-hhMc3ZeuOQY7pqR7_czG6FisU2yZ1bhTg/copy
Now i will not be capable of share with you the set off in a sheet. If I create a set off, then one other person cannot see it.
In the event you create a set off and share me on a sheet, I am unable to see that set off. It is a kind of bizarre issues about Triggers that you simply study in Spreadsheet Automation 101.
However let me stroll you thru including a set off proper now.
Go to the “clock” icon on the left facet. if you happen to hover over the sidebar on the left, the textual content will seem. click on on “Triggers”
then go to the underside proper nook and click on “Add Set off”
As a result of there’s just one script, the script “emailMe” will already be chosen.
Scroll all the way down to “Choose occasion supply”
and click on on an change “From Spreadsheet” to “Time-Pushed”
Then below that you will see “Hour timer” change that to “Day Timer”
then you may choose an hour inside which you need to ship the e-mail.
Choose the hour, then click on the blue “SAVE” button.
and you may see a set off seem.
you may delete that set off anytime. verify again an hour after the hour you chose and see if it labored. if it did it can ship you an e mail day-after-day.
Once more.. you may all the time delete that set off.
Please strive to not ship me an automated e mail of your take a look at day-after-day. I hope you modified the e-mail to your self
In the event you loved this tutorial, you may most likely LOVE Spreadsheet Automation 101
A whole video course you may take anytime is on the market on Udemy. And sometimes I will run a dwell cohort class by way of Maven: https://maven.com/bettersheets/spreadsheet-automation-101
Higher Sheets Members get Spreadsheet Automation 101 included with each their month-to-month membership and lifelong membership.
